home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / THINK C Digest / 1991 / 91-02 < prev    next >
Text File  |  1995-12-31  |  99KB  |  2,808 lines

  1. 
  2. Path: ucivax!gateway
  3. From: dmac@eagle.mit.edu ("David S. McCormick")
  4. Subject: Problems with one CDEV/INIT appearing twice on startup
  5. Message-ID: <9102021451.AA10573@EAGLE.MIT.EDU>
  6. Newsgroups: fa.think-c
  7. Lines: 20
  8. Date: 2 Feb 91 14:53:27 GMT
  9.  
  10. I was trying to do the Code resources/CDEV example from the Macintosh
  11. Programming Primer vol. II (by Dave Mark, Addison Wesley 1990). I have
  12. gotten it to work, but when the INIT loads, it the icon shows up twice
  13. along the lower boundary. The code for icon display is (essentially)
  14. ShowINIT by Paul Mercier.
  15. My question is: what makes the Finder or Mac startup recognize that
  16. there is an INIT that must be loaded? What would make it think that
  17. there are two of this thing?
  18. Any help appreciated.
  19.  
  20. Cheers,
  21. David S. McCormick
  22. MIT-EAPS Geology
  23. Bldg. 54-1016
  24. Cambridge, MA 02139
  25. 617-253-9852
  26. dmac@eagle.mit.edu
  27. CompuServe: 71540,2765
  28. Disclaimer: Grad students are, for all intents and purposes, unemployed,
  29. and therefore don't need disclaimers.
  30. 
  31. 
  32. Path: ucivax!gateway
  33. From: dmac@eagle.mit.edu ("David S. McCormick")
  34. Subject: Another problems with one CDEV/INIT
  35. Message-ID: <9102021524.AA10621@EAGLE.MIT.EDU>
  36. Newsgroups: fa.think-c
  37. Lines: 19
  38. Date: 2 Feb 91 15:28:45 GMT
  39.  
  40. I rooted around with ResEdit and found that the I had 2 INIT resources
  41. in my CDEV. I pasted a single INIT resource into the cdev.9.rsrc file
  42. with ID=0. After choosing Build Code Resource... the final code resource
  43. had two, nearly identical INIT resources, one of ID=0 and one of ID=128.
  44. Why did the compiler create another INIT resource? Would this have been
  45. prevented if I had pasted in the INIT resource after compiling? Should I
  46. have changed the INIT resource's ID? As you can tell, code resources are
  47. totally foreign to me.
  48. Thanks again.
  49. Cheers,
  50. David S. McCormick
  51. MIT-EAPS Geology
  52. Bldg. 54-1016
  53. Cambridge, MA 02139
  54. 617-253-9852
  55. dmac@eagle.mit.edu
  56. CompuServe: 71540,2765
  57. Disclaimer: Grad students are, for all intents and purposes, unemployed,
  58. and therefore don't need disclaimers.
  59. 
  60. 
  61. Path: ucivax!gateway
  62. From: dmac@eagle.mit.edu ("David S. McCormick")
  63. Subject: 1: How do you implement CTask subclass? 2: Is it better to Close a file immediately after Open-Read
  64. Message-ID: <9102031803.AA13540@EAGLE.MIT.EDU>
  65. Newsgroups: fa.think-c
  66. Lines: 23
  67. Date: 3 Feb 91 18:04:44 GMT
  68.  
  69. (1) I would like any suggestions about how to implement the subclasses
  70. of CTask. Specifically:
  71.  
  72. What info needs to be stored in a task?
  73. Where in the application does MyTask get invoked? What do you send with
  74. the message?
  75. What is the CTask::Do() method? How does it differ from the Undo/Redo?
  76.  
  77. (2) Is it better form or safer to Close() a file immediately after
  78. Opening and Reading contents?
  79.  
  80. Thanks for any suggestions.
  81.  
  82. Cheers,
  83. David S. McCormick
  84. MIT-EAPS Geology
  85. Bldg. 54-1016
  86. Cambridge, MA 02139
  87. 617-253-9852
  88. dmac@eagle.mit.edu
  89. CompuServe: 71540,2765
  90. Disclaimer: Grad students are, for all intents and purposes, unemployed,
  91. and therefore don't need disclaimers.
  92. 
  93. 
  94. Path: ucivax!gateway
  95. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  96. Subject: 020/881
  97. Message-ID: <9102041711.AA05863@neuromancer>
  98. Newsgroups: fa.think-c
  99. Lines: 43
  100. Date: 4 Feb 91 19:34:41 GMT
  101.  
  102. I'm trying to maintain two versions of some calc-intensive code under ThC.
  103.  
  104. Is there any way to know within the code whether it's being compiled with either
  105. the 68020 and/or 68881 options?
  106.  
  107. For example, it would be great to use a source file that does:
  108.  
  109.     #ifdef MC68020
  110.     #asm MC68020 {
  111.         /* assembly optimizations that scream through
  112.  
  113.             tight loops on a Mac II class machine
  114.          */
  115.     }
  116.     #else
  117.     #asm MC68000 {
  118.         /* assembly optimizations that run faster than
  119.             ThC code, but still work on Classics,etc.
  120.          */
  121.     }
  122.     #endif
  123.  
  124. The code needs to be inline, as opposed to a separate library, and it would
  125.  
  126. be a lot easier to maintain "n" source files instead of "2n" files.  Even an explicit
  127. "ifdef" in one of the header files would be nasty in this project....  And speaking
  128. as a former compiler-writer, MOST COMPILERS AUTOMATICALLY GENERATE
  129. DEFINES FOR THEIR OPTIONS...
  130.  
  131. Thanks, and happy hacking!
  132.  
  133. -paco
  134. ----
  135. Internet:    paco@neuromancer.sps.mot.com
  136. AppleLink:    Nathan2
  137. Voice Mail:    1.512.891.2973
  138.  
  139. Neural Networks & Virtual Reality Development
  140. Center for Emerging Computer Technologies
  141. Motorola, Inc.
  142. Austin, Texas, USA
  143.  
  144. (c)1990, PXN. Subject to Public Law 99-508.  B*B!
  145. 
  146. 
  147. Path: ucivax!gateway
  148. From: dmac@eagle.mit.edu ("David S. McCormick")
  149. Subject: Trouble using TextFont() in Panorama
  150. Message-ID: <9102050753.AA26002@EAGLE.MIT.EDU>
  151. Newsgroups: fa.think-c
  152. Lines: 22
  153. Date: 5 Feb 91 07:54:34 GMT
  154.  
  155. I am using a hierarchical font menu in conjunction with a panorama and I
  156. am having trouble getting the font displayed in my panorama panorama to
  157. match the menu selection. I borrowed the fontItem instance variable from
  158. CEditText along with the DoCommand() and UpdateMenus() fragments which
  159. have to do with the Font menu. The instance variable gets changed
  160. correctly if I select the font menu. I set the default of the instance
  161. variable to monaco. My quickdraw calls are done into picture, and just
  162. before I need to draw the text I call TextFont( fontItem ). What I get
  163. the first time through, before I change anything, is the font as monaco.
  164. If I choose a new font, the font changes to geneva (applFont), but never
  165. changes after that. What am I missing? Do I have to call TextFont()
  166. before Prepare()? Do I have to call TextFont() before OpenPicture()? Any
  167. help appreciated.
  168.  
  169. Cheers,
  170. David S. McCormick
  171. MIT-EAPS Geology
  172. Bldg. 54-1016
  173. Cambridge, MA 02139
  174. 617-253-9852
  175. dmac@eagle.mit.edu
  176. CompuServe: 71540,2765
  177. 
  178. 
  179. Path: ucivax!gateway
  180. From: nick@lfcs.edinburgh.ac.UK (Nick Rothwell)
  181. Subject: Re: 020/881
  182. Message-ID: <11967.9102051029@lfcs.ed.ac.uk>
  183. Newsgroups: fa.think-c
  184. Lines: 27
  185. Date: 5 Feb 91 11:33:08 GMT
  186.  
  187. >For example, it would be great to use a source file that does:
  188. >
  189. >    #ifdef MC68020
  190. >    #asm MC68020 {
  191. >        /* assembly optimizations that scream through
  192. >
  193. >            tight loops on a Mac II class machine
  194. >         */
  195. >    }
  196. >    #else
  197. >    #asm MC68000 {
  198. >        /* assembly optimizations that run faster than
  199. >            ThC code, but still work on Classics,etc.
  200. >         */
  201. >    }
  202. >    #endif
  203.  
  204. My feeling is that this is rather Macintosh-unfriendly, as you end up with
  205. two versions of your application, one for each kind of machine. Better to
  206. ask the Mac what processor it has (via SysEnvirons, Gestalt, whatever) and
  207. switch to the correct portion of code. That way you have one application
  208. that can run on anything.
  209.  
  210. Well, it's just a thought.
  211.  
  212. Nick.
  213.  
  214. 
  215. 
  216. Path: ucivax!gateway
  217. From: gstein@us.oracle.COM (Greg Stein)
  218. Subject: Re: 020/881
  219. Message-ID: <9102051530.AA24935@hqsun4.us.oracle.com>
  220. Newsgroups: fa.think-c
  221. Lines: 47
  222. Date: 5 Feb 91 15:34:38 GMT
  223.  
  224. You can always package your processor-specific code into a code
  225. resource and dynamically load/link it into your program based on
  226. Gestalt.  This would provide you the benefit that both versions of the
  227. program do not have to be in memory simultaneously.
  228.  
  229. Dynamically loading code resources is not that difficult to do, once
  230. you get the hang of it.
  231.  
  232.  
  233. Greg Stein
  234. Arpa: gstein%oracle.uucp@apple.com
  235. UUCP: ..!{uunet,apple}!oracle!gstein
  236.  
  237.  
  238. ---- Included Message ----
  239. From: Nick Rothwell <nick@lfcs.edinburgh.ac.UK>
  240. Newsgroups: fa.think-c
  241. Date: 5 Feb 91 11:33:08 GMT
  242.  
  243. >For example, it would be great to use a source file that does:
  244. >
  245. >    #ifdef MC68020
  246. >    #asm MC68020 {
  247. >        /* assembly optimizations that scream through
  248. >
  249. >            tight loops on a Mac II class machine
  250. >         */
  251. >    }
  252. >    #else
  253. >    #asm MC68000 {
  254. >        /* assembly optimizations that run faster than
  255. >            ThC code, but still work on Classics,etc.
  256. >         */
  257. >    }
  258. >    #endif
  259.  
  260. My feeling is that this is rather Macintosh-unfriendly, as you end up with
  261. two versions of your application, one for each kind of machine. Better to
  262. ask the Mac what processor it has (via SysEnvirons, Gestalt, whatever) and
  263. switch to the correct portion of code. That way you have one application
  264. that can run on anything.
  265.  
  266. Well, it's just a thought.
  267.  
  268. Nick.
  269.  
  270.  
  271. 
  272. 
  273. Path: ucivax!gateway
  274. From: dmac@eagle.mit.edu ("David S. McCormick")
  275. Subject: Disabling Hier Menu (was: Trouble using TextFont() in Panorama)
  276. Message-ID: <9102051556.AA29083@EAGLE.MIT.EDU>
  277. Newsgroups: fa.think-c
  278. Lines: 33
  279. Date: 5 Feb 91 15:59:52 GMT
  280.  
  281. OK, so I was tired at 2AM and didn't read CEditText closely enough. I
  282. found out that a call to LoShort(-theCommand) extracts the _item number_
  283. of the menu item, not the _font number_.... I've fixed it to correctly
  284. set both the font item number and get the correct text.
  285.  
  286. I have a new problem (what a surprise): How do you disable a
  287. hierarchical menu name in the menu to which it's attached. I have a menu
  288. called "Plot" to which is attached the "Font" hierarchical menu. I used
  289.  
  290. gBartender->DisableMenu( MENUfont )
  291.  
  292. but this has 2 undesirable (or incomplete) side-effects: (1) there is
  293. some nasty menu bar flicker whenever I call DisableMenu(), so I try to
  294. just use DisableCmd() wherever possible (I have are several edit text
  295. fields that each to refresh the menu bar). (2) This is the real problem:
  296. Although, all the Font menu items are disabled, I cannot disable the
  297. "Font" menu text in the "Plot" menu; whenever I try to do this by
  298. extracting item numbers and converting them to command numbers, the
  299. command number points to the hierarchical menu (MENUid), not the Plot
  300. menu. Am I missing something? Is there a way to disable the label (and
  301. forego using DisableMenu() )? [As a side question, can you even do this
  302. with a straight Toolbox call?]
  303.  
  304. Thanks in advance.
  305.  
  306. Cheers,
  307. David S. McCormick
  308. MIT-EAPS Geology
  309. Bldg. 54-1016
  310. Cambridge, MA 02139
  311. 617-253-9852
  312. dmac@eagle.mit.edu
  313. CompuServe: 71540,2765
  314. 
  315. 
  316. Path: ucivax!gateway
  317. From: peter@pdact.pd.necisa.oz.au (Peter Miller)
  318. Subject: Re: 020/881
  319. Message-ID: <9102052207.AA04071@elm>
  320. Newsgroups: fa.think-c
  321. Lines: 26
  322. Date: 6 Feb 91 02:01:20 GMT
  323.  
  324.  
  325. > Better to
  326. > ask the Mac what processor it has (via SysEnvirons, Gestalt, whatever) and
  327. > switch to the correct portion of code. That way you have one application
  328. > that can run on anything.
  329.  
  330. This is one of my gripes with the Mac.
  331.  
  332. Has anyone done a 68881 emulator INIT?
  333. I.e. trap 68881 opcodes and emulate them in software, in the absence of
  334. a 68881.  [This is what my 68000 books says the F-line traps are for.]
  335. That way, I could drop the init into my system folder on any machine
  336. without a 68881, and it would behave as if it did (if the INIT was smart
  337. it would check if a real 68881 was there, and do nothing if so).
  338. Then, all code can assume a 68881, and we don't wind up with
  339. two versions of all floating-point applications.
  340.  
  341. Regards
  342. Peter Miller    UUCP    uunet!munnari!pdact.pd.necisa.oz!pmiller
  343.         ACSnet    pmiller@pdact.pd.necisa.oz
  344. /\/\*        CSNET    pmiller@pdact.pd.necisa.oz.au
  345. Disclaimer:  The views expressed here are personal and do not necessarily
  346.     reflect the view of my employer or the views or my colleagues.
  347.  
  348. "I have discovered that in this business you need animators,
  349. accountants and bookkeepers can't do it." - Walt Disney.
  350. 
  351. 
  352. Path: ucivax!gateway
  353. From: minow@bolt.enet.dec.COM ("Martin Minow, ML3-5/U26  04-Feb-1991 1512")
  354. Subject: re: CTask subclass
  355. Message-ID: <9102060257.AA10994@decpa.pa.dec.com>
  356. Newsgroups: fa.think-c
  357. Lines: 131
  358. Date: 6 Feb 91 03:00:57 GMT
  359.  
  360. Funny, I did that last night.  Took about an hour, most of which was
  361. spent mumbling to myself and wiping tears off the manual.  Most of the
  362. code will transport to your application without trouble.  I suspect that
  363. I might update SplitsDoc::SetSomeValue so it has a non-undoable entry
  364. point (for reasons unrelated to this example).
  365.  
  366. Hope this helps.
  367.  
  368. Martin Minow.
  369. minow@bolt.enet.dec.com
  370.  
  371. /*
  372.  * ValueTask header.
  373.  */
  374. #define _H_ValueTask
  375. #include <CTask.h>
  376. #include "SplitsDoc.h"
  377.  
  378. struct ValueTask : CTask {
  379.     short        itsClass;
  380.     short        itsDistance;
  381.     double        itsElapsed;
  382.     CharsHandle    itsLeader;
  383.  
  384.     void        IValueTask(
  385.         SplitsDoc    *aSplitsDoc
  386.     );
  387.     void    Dispose(void);
  388.     void    Undo(void);
  389. };
  390.  
  391. /*
  392.  * ValueTask.c
  393.  */
  394. #include "ValueTask.h"
  395. #include "SplitsDoc.h"
  396.  
  397. /*
  398.  * This is called (by the OK button) just before I store some
  399.  * data away.  SplitsDoc is the "document" class.
  400.  */
  401. void
  402. ValueTask::IValueTask(
  403.     SplitsDoc    *aSplitsDoc
  404.     )
  405. {
  406.     /*
  407.      * I store stuff in a ValueList (list of values).
  408.      * One of the things I store is a CharsHandle
  409.      * that originates in a CEditPane.  Note the
  410.      * way HandToHand is called.
  411.      */
  412.     ValueList        *aValueList;
  413.     CharsHandle        currentLeader;
  414.     OSErr            status;
  415.  
  416.     inherited::ITask(UNDO_NewValue);
  417.     aValueList = aSplitsDoc->itsValueList;
  418.     itsClass = aSplitsDoc->itsClassIndex;
  419.     itsDistance = aValueList->GetSelection();
  420.     itsElapsed = aValueList->GetElapsed(itsDistance);
  421.     /*
  422.      * Duplicate the leader (stored in a CEditPane instance).
  423.      */
  424.     currentLeader = aSplitsDoc->CurrentLeader();
  425.     status = HandToHand(¤tLeader);
  426.     gError->CheckOSError(status);
  427.     itsLeader = currentLeader;
  428. }
  429.  
  430. void
  431. ValueTask::Dispose()
  432. {
  433.     if (itsLeader != NULL)
  434.         DisposHandle((Handle) itsLeader);
  435.     inherited::Dispose();
  436. }
  437.  
  438. /*
  439.  * TCL calls this upon Undo.
  440.  */
  441. void
  442. ValueTask::Undo()
  443. {
  444.     SplitsDoc    *aSplitsDoc;
  445.     SplitsDocList    *theDocList;
  446.     ValueList    *theValueList;
  447.     ValueItem    *theValue;
  448.  
  449.     theDocList = gApplication->raceClasses;
  450.     aSplitsDoc = theDocList->GetSplitsDoc(itsClass);
  451.     if (aSplitsDoc != NULL) {
  452.         /*
  453.          * Store the value and update the data entry dialog.
  454.          */
  455.         aSplitsDoc->SetSomeValue(itsDistance, itsElapsed, itsLeader);
  456.         aSplitsDoc->PutSelectedSplitInDialog();
  457.     }
  458. }
  459.  
  460. /*
  461.  * This is the SplitsDoc method that stores data in the value list.
  462.  */
  463. void
  464. SplitsDoc::SetSomeValue(
  465.     short        aDistance,    /* Distance we're changing    */
  466.     double        anElapsed,    /* Time at this distance    */
  467.     CharsHandle    aLeader        /* Who is leading the race    */
  468.     )
  469. {
  470.     ValueTask    *aValueTask;
  471.     ValueItem    *theValue;
  472.  
  473.     /*
  474.      * Save enough information to Undo the action.
  475.      */
  476.     aValueTask = new(ValueTask);
  477.     aValueTask->IValueTask(this);
  478.     /*
  479.      * Next, store the new data.
  480.      */
  481.     theValue = itsValueList->GetItem(aDistance);
  482.     theValue->StoreSplit(anElapsed, aLeader);
  483.     itsValueList->ChangeSelection(aDistance);
  484.     /*
  485.      * Inform the document and TCL
  486.      */
  487.     dirty = TRUE;
  488.     Notify(aValueTask);
  489. }
  490.  
  491. 
  492. 
  493. Path: ucivax!gateway
  494. From: siegel@das.harvard.edu (Rich Siegel)
  495. Subject: Re: 020/881
  496. Message-ID: <9102060414.AA06471@endor.harvard.edu>
  497. Newsgroups: fa.think-c
  498. Lines: 31
  499. Date: 6 Feb 91 04:18:52 GMT
  500.  
  501.  
  502. [Peter expresses a desire for a 68881 emulator INIT in order to avoid having
  503. to ship two versions of software for FPU vs non-FPU systems.]
  504.  
  505. Emulators are not a cure-all. First of all, an emulator will be far slower
  506. on a machine than SANE is, which misses the whole point of having an
  507. emulator (i.e. better floating-point performance). Second, an emulator
  508. will be huge, since it has to emulate ALL of the possible opcodes and
  509. addressing modes that may be generated, including some of the el-wierdo
  510. 68020-type "base address register with index and outer displacement and
  511. memory indirect" modes, which are truly horrendous.
  512.  
  513. If you don't want to have two projects which differ only in compiler settings,
  514. and possibly only in a few utility routines which have been rewritten
  515. in 881 assembly language, then supply your users with a SANE-compiled
  516. version. SANE uses the FPU if it's there, and many third-party companies
  517. (Radius and Daystar come to mind) have INITs which route SANE calls to
  518. the built-in FPU. Also, SANE is more accurate in some cases.
  519.  
  520. -- which reminds me of a third gotcha: with an emulator, you're at the mercy
  521. of whoever wrote it, so if it's got bugs or inaccuracies, you're going to have
  522. a million calls of "Why doesn't it work on my IIsi without an FPU?", when
  523. you're testing your brains out and it works perfectly on your Mac II.
  524.  
  525. Who says "real men don't do floating point"? :-)
  526.  
  527. R.
  528.  
  529.  Rich Siegel    Symantec Languages Group  Internet: siegel@endor.harvard.edu
  530.  
  531. "I was just trying to be subtle. That's my job, isn't it?"
  532. 
  533. 
  534. Path: ucivax!gateway
  535. From: rsfinn@athena.mit.edu ("Russell S. Finn")
  536. Subject: Re: 020/881
  537. Message-ID: <9102060516.AA02043@e40-008-7.MIT.EDU>
  538. In-Reply-To: Peter Miller's message of 06 Feb 91 02:01:20 +0000.
  539.              <9102052207.AA04071@elm>
  540. Newsgroups: fa.think-c
  541. Lines: 31
  542. Date: 6 Feb 91 05:20:55 GMT
  543.  
  544.  
  545. Peter writes:
  546.  
  547. > Has anyone done a 68881 emulator INIT?
  548. > I.e. trap 68881 opcodes and emulate them in software, in the absence of
  549. > a 68881.  [This is what my 68000 books says the F-line traps are for.]
  550. > That way, I could drop the init into my system folder on any machine
  551. > without a 68881, and it would behave as if it did (if the INIT was smart
  552. > it would check if a real 68881 was there, and do nothing if so).
  553. > Then, all code can assume a 68881, and we don't wind up with
  554. > two versions of all floating-point applications.
  555.  
  556. Those of us that have IIsi's are grateful for an INIT called PseudoFPU
  557. (available from your favorite archive), which traps the FPU
  558. instructions and calls SANE -- not speedy, but it works, and allows us
  559. to run programs that assume that anything with a 68030 also has an
  560. FPU.  I believe it disables itself if an FPU is really present; it
  561. also disables itself in the presence of Excel and DataDesk, which will
  562. use their own floating point routines if there is no FPU (and so run
  563. faster -- PseudoFPU is supposed to be *100 times slower* than an FPU).
  564.  
  565. Truly portable Macintosh applications are supposed to use SANE for
  566. their floating point arithmetic, since it's (1) always present and (2)
  567. more accurate than the 881/882.  (SANE on a machine with an FPU uses
  568. the FPU; otherwise it's all done in software.)  However, Apple
  569. recognizes that using the FPU directly is faster than calling SANE (at
  570. least, it does as of the second edition of the "Apple Numerics
  571. Manual"); it's mentioned as a speed/portability tradeoff.
  572.  
  573. -- Russell S. Finn
  574. rsfinn@{athena,lcs}.mit.edu
  575. 
  576. 
  577. Path: ucivax!gateway
  578. From: ech@pegasus.attmail.COM
  579. Subject: Re: 020/881
  580. Original-From: attmail!pegasus!ech (Ned Horvath )
  581. Lines: 38
  582. Date: 6 Feb 91 19:21:47 GMT
  583. Message-Service: mail
  584. Message-ID: <9102061117.aa01106@ICS.UCI.EDU>
  585. In-Reply-To: your message <internet0370730130> of Wed Feb 6 05:20:55 GMT 1991
  586. >To: internet!ics.uci.edu!think-c
  587. Content-Type: Text
  588. Content-Length: 2043
  589. Newsgroups: fa.think-c
  590. Message-Version: 2
  591. EMail-Version: 2
  592. UA-Message-ID: <MAC-1.3.4A1-618034-ech-817>
  593. UA-Content-ID: <PMX-PC-2.01A-000146-pegasus3-ech-1038>
  594. MTS-Message-ID: <pegasus0371624040>
  595.  
  596. ------------ Original Message -------------
  597. ...
  598. Truly portable Macintosh applications are supposed to use SANE for
  599. their floating point arithmetic, since it's (1) always present and (2)
  600. more accurate than the 881/882.  (SANE on a machine with an FPU uses
  601. the FPU; otherwise it's all done in software.)  However, Apple
  602. recognizes that using the FPU directly is faster than calling SANE (at
  603. least, it does as of the second edition of the "Apple Numerics
  604. Manual"); it's mentioned as a speed/portability tradeoff.
  605.  
  606. -- Russell S. Finn
  607. rsfinn@{athena,lcs}.mit.edu
  608. --------- End of Original Message ---------
  609.  
  610. The tradeoff is quite large: when I worked for Manx (Aztec C) we implemented
  611. direct-F-line instructions for floating point as an option.  With that option,
  612. the 68881 is about 400 times faster than "raw" SANE, and about 20 times faster
  613. than letting SANE call the '881.  This isn't surprising -- inline code avoids
  614. a subroutine call and the test for FPU present.
  615.  
  616. The tradeoff is the accuracy mentioned and the requirement that you have a
  617. "FPU only" version of your application, or follow one of the other
  618. recommendations (keep the FP in a separately compiled "PACKage" and install
  619. the one that fits when you start up).  But that factor of 20 can make a BIG
  620. difference when the application is FP intensive.
  621.  
  622. OK, on the soapbox: Floating Point is for quick knockoffs and programmers with
  623. weak minds: you (almost) always can do a given job using much less expensive
  624. fixed-point arithmetic: use integers, but with the binary point somewhere
  625. other than the extreme right.  T'ain't hard, but fixed point does require that
  626. you understand the problem domain well, and that the "domain of discourse" is
  627. only a few orders of magnitude in size, but that describes almost all problems
  628. where FP is used.  A couple of good commercial examples are MacSwivel and
  629. MacSpin, neither of which use floating point to do some pretty magical things,
  630. and they run with good pace even on a Mac Plus.  Standing down from soapbox...
  631.  
  632. =Ned Horvath=
  633. ehorvath@attmail.com
  634. 
  635. 
  636. Path: ucivax!gateway
  637. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  638. Subject: re: 020/881
  639. Message-ID: <9102062015.AA06569@neuromancer>
  640. Newsgroups: fa.think-c
  641. Lines: 32
  642. Date: 6 Feb 91 22:08:27 GMT
  643.  
  644. Thanks for all the advice on detecting compiler options.
  645.  
  646.  
  647. I understand the Gestalt/SysEnvirons argument and in 99% of my applications, especially
  648. the commercial releases, I would agree.
  649.  
  650.  
  651. BUT, inside a critical, tight loop where one would typically use inline assembly, making a
  652. call out to another code resource, another routine is the wrong approach.  So some kind of
  653. "ifdef" seems the best way to maintain both 020/881 & 000 compatible code.  I just run two
  654. separate projects off the same source code and generate two separate applications.  Of
  655. course, some kind of change administration built into ThC projects would be even better....
  656.  
  657. I'd also argue about the size of the Mac software development market that is targeted for
  658. "proof of concept".  The politically correct Mac "guidelines" aim for the shrink-wrap market
  659. and semi-naive users.  Great, yup 99% of the time.  On the other hand, I'd say that a large
  660. bulk of $$ going into Mac software development is for demonstration purposes, "proof of
  661. concept", being able to rapidly prototype and demo a business opportunity in front of a
  662. vice president, an academic dean, etc.  I'm curious whether other folks who earn their
  663. keep off the Mac would agree.
  664.  
  665. pacoid.
  666. ----
  667. Internet:    paco@neuromancer.sps.mot.com
  668. AppleLink:    Nathan2
  669. Voice Mail:    1.512.891.2973
  670.  
  671. Neural Networks & Virtual Reality Development
  672. Center for Emerging Computer Technologies, Motorola, Inc.
  673. Austin, Texas, USA
  674.  
  675. (c)1990, PXN. Subject to Public Law 99-508.  B*B!
  676. 
  677. 
  678. Path: ucivax!gateway
  679. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  680. Subject: MacsBug's Bugs
  681. Message-ID: <9102062020.AA06575@neuromancer>
  682. Newsgroups: fa.think-c
  683. Lines: 18
  684. Date: 6 Feb 91 22:08:48 GMT
  685.  
  686. Okay, here's a weird one.  I take a well-working Mac II, have NYNEX upgrade it to a IIfx,
  687. then run 6.0.7 with no extraneous INIT's or CDEV's, except for MacsBug 6.1 straight out of
  688. the shrink-wrap from APDA
  689.  
  690. But when I hit the programmer switch, MacsBug comes up and promptly hangs.  I get an
  691. NMI and the command line editor cursor blinks, but it won't except any input from the
  692. keyboard.
  693.  
  694. I've checked in with Apple, but so far nobody's seen this before.  Sound like just a bad
  695. logic board upgrade?
  696.  
  697. pacoid.
  698. ----
  699. Internet:    paco@neuromancer.sps.mot.com
  700. AppleLink:    Nathan2
  701. Voice Mail:    1.512.891.2973
  702.  
  703. (c)1990, PXN. Subject to Public Law 99-508.  B*B!
  704. 
  705. 
  706. Path: ucivax!gateway
  707. From: autodesk!ceili!bobert@uunet.uu.NET (Robert Murphy)
  708. Subject: Re: 020/881
  709. Message-ID: <9102062146.AA24020@ceili.YP.acad>
  710. Newsgroups: fa.think-c
  711. Lines: 66
  712. Date: 6 Feb 91 22:35:08 GMT
  713.  
  714. Ned Horvath writes:
  715.  
  716. >The tradeoff is quite large: when I worked for Manx (Aztec C) we implemented
  717. >direct-F-line instructions for floating point as an option.  With that option,
  718. >the 68881 is about 400 times faster than "raw" SANE, and about 20 times faster
  719. >than letting SANE call the '881.  This isn't surprising -- inline code avoids
  720. >a subroutine call and the test for FPU present.
  721.  
  722. These statements are quite true.  Back in the dim dark ages (pre-Mac II),
  723. when the only 020/881 option was the Levco Prodigy, I was one of the
  724. programmers on a commercial product named Trapeze, and was the numerics
  725. guy.  As an example of the speed tradeoffs, I found at the time that doing
  726. a particular matrix inversion required about several minutes using SANE on
  727. a 16 MHz 68020; in those days (1986), SANE didn't know about FPUs yet.
  728. When I simply replaced my adds, multiplies and divides with function calls
  729. to inline assembly which used the FPU, the inversion went to five seconds.
  730. Later, just for fun, I hand-tweaked the entire matrix inversion routine
  731. in 020/881 assembly, and got it down to 1/2 second.
  732.  
  733. >The tradeoff is the accuracy mentioned and the requirement that you have a
  734. >"FPU only" version of your application, or follow one of the other
  735. >recommendations (keep the FP in a separately compiled "PACKage" and install
  736. >the one that fits when you start up).  But that factor of 20 can make a BIG
  737. >difference when the application is FP intensive.
  738.  
  739. I've found the accuracy tradeoff to be a complete non-issue.  The 881
  740. and SANE give you exactly the same results, down to the last bit, for
  741. fundamental operations (add, subtract, multiply, divide, etc.)  You
  742. only notice a difference when using transcendentals with the extended
  743. (80-bit) floating point type, and the biggest difference I ever noted for
  744. a single operation was in the least significant bit of the 64-bit
  745. mantissa - big hairy deal.  Of course, this kind of error can accumulate
  746. if you're doing long, complicated sets of operations like calculating
  747. eigenvectors of large matrices - but numerical instability due to accumulated
  748. roundoff is part of life in the world of numerical analysis, as any textbook
  749. on the subject will tell you, and even SANE is not immune to the problem;
  750. it just falls apart when you use a 51x51 matrix instead of the 50x50
  751. you get with the FPU.  I daresay that either one is a hell of a lot better
  752. when you use 80-bit reals than what you'd get with the 64-bit reals you
  753. get stuck with in the Intel world.
  754.  
  755. >OK, on the soapbox: Floating Point is for quick knockoffs and programmers with
  756. >weak minds: you (almost) always can do a given job using much less expensive
  757. >fixed-point arithmetic: use integers, but with the binary point somewhere
  758. >other than the extreme right.  T'ain't hard, but fixed point does require that
  759. >you understand the problem domain well, and that the "domain of discourse" is
  760. >only a few orders of magnitude in size, but that describes almost all problems
  761. >where FP is used.  A couple of good commercial examples are MacSwivel and
  762. >MacSpin, neither of which use floating point to do some pretty magical things,
  763. >and they run with good pace even on a Mac Plus.  Standing down from soapbox...
  764.  
  765. I disagree completely.  There is some truth in what Ned says about when
  766. you might be able to apply fixed point math, but he is just flat wrong
  767. when he says that such situations encompass "almost all problems where
  768. FP is used".  You can begin by removing from "almost all problems" a
  769. huge chunk of CAD, especially 3-D, and also much of scientific computing.
  770. I work in both problem domains, and I don't use floating point because
  771. I'm lazy or stupid - I use them because nothing else would work.
  772.  
  773. >=Ned Horvath=
  774. >ehorvath@attmail.com
  775. >
  776.  
  777. Bob Murphy
  778. bobert@autodesk.com
  779.  
  780. 
  781. 
  782. Path: ucivax!gateway
  783. From: peter@pdact.pd.necisa.oz.au (Peter Miller)
  784. Subject: Re: 020/881
  785. X-Face: u\%{\QY_5[S37dfQ#c*#""=K,KGq>4wGryNm+=TT]1jOGap~>j*-sb9d|ll.sHIJu&n{:T`
  786.  cP|e(B?o,W%l_)o5pW,"MVie?sw{hZ@7E^o`C:wz){1p!u%O<N#lcPP]b|f:2,-mNKt{Ue(_7e"ok@
  787.  b".~TQ#YGrlY[r!:5q[/"O&Bn4:3mwuUFt>Qc]KTq}A")Jk,[
  788. Message-ID: <9102070112.AA05159@elm>
  789. In-Reply-To: Your message of Tue, 05 Feb 91 23:14:21 -0500.
  790.              <9102060414.AA06471@endor.harvard.edu>
  791. Newsgroups: fa.think-c
  792. Lines: 81
  793. Date: 7 Feb 91 03:19:59 GMT
  794.  
  795.  
  796. I got a bigger response with this than I expected.
  797. Thanks, everyone who responded.
  798. I wasn't a clear as I could have been, though.
  799.  
  800. siegel@das.harvard.edu (Rich Siegel) writes:
  801. >
  802. > [Peter expresses a desire for a 68881 emulator INIT in order to avoid having
  803. > to ship two versions of software for FPU vs non-FPU systems.]
  804. >
  805. > Emulators are not a cure-all. First of all, an emulator will be far slower
  806. > on a machine than SANE is,
  807. Hmm, I don't understand this.
  808. Don't they have to do a similar amount of work?
  809. In fact, since SANE is more accurate, wouldn't the emulator be faster,
  810. because it has less to do?
  811.  
  812. > which misses the whole point of having an
  813. > emulator (i.e. better floating-point performance).
  814. I don't want the emulator for better floating point performance
  815. than SANE gives me, I want it instead of SANE.
  816.  
  817. > Second, an emulator will be huge,
  818. Hmm, I don't understand this, either.
  819. Don't they do a similar amount of work?
  820. In fact, since SANE is more accurate, wouldn't the emulator be smaller,
  821. because it has less to do?
  822.  
  823. > since it has to emulate ALL of the possible opcodes and
  824. > addressing modes that may be generated, including some of the el-wierdo
  825. > 68020-type "base address register with index and outer displacement and
  826. > memory indirect" modes, which are truly horrendous.
  827. I have a feeling, having implemented emulators of various chips
  828. (no FPUs, I admit), that addressing modes are trivial when compared with the
  829. compexity of the actual floating-point emulation.
  830.  
  831. > If you don't want to have two projects which differ only in compiler
  832. > settings, and possibly only in a few utility routines which have been
  833. > rewritten in 881 assembly language, then supply your users with a
  834. > SANE-compiled version.  SANE uses the FPU if it's there,
  835. As another poster pointed out, this is still a 20x performance hit
  836. vs using the FPU direct.
  837.  
  838. > and many third-party companies (Radius and Daystar come to mind) have INITs
  839. > which route SANE calls to the built-in FPU.
  840. Eh?  Doesn't SANE do this?  (OK, maybe with some niggling value added.)
  841.  
  842. > Also, SANE is more accurate in some cases.
  843. Claims of additional accuracy don't win me,
  844. because when I can get mucho-speed for niggling-accuracy (20 times faster,
  845. vs. 2^-55 increase in accuracy of answers) I will use direct 68881 opcodes
  846. every time.
  847.  
  848. > -- which reminds me of a third gotcha: with an emulator, you're at the mercy
  849. > of whoever wrote it, so if it's got bugs or inaccuracies, you're going to
  850. > have a million calls of "Why doesn't it work on my IIsi without an FPU?",
  851. > when you're testing your brains out and it works perfectly on your Mac II.
  852. Hardware has bugs, too.
  853.  
  854.  
  855. Perhapse I could have asked the question
  856.     "Why didn't apple do an FPU emulator, rather than SANE?"
  857.     (given that the wins, from my point of view, are small or negative)
  858. and
  859.     "Given that I think apple got it wrong, where can I get an emulator?"
  860. And, yes, I have FTP'd PseudoFPU, will try it shortly.
  861.  
  862. The other thing is that the emulator would not have needed to be loaded
  863. at boot time, of the hardware was there (if apple had done an emulator,
  864. rather than SANE).  As it is I get SANE and the FPU,
  865. and I don't use SANE (on machines with FPUs).
  866.  
  867. Regards
  868. Peter Miller    UUCP    uunet!munnari!pdact.pd.necisa.oz!pmiller
  869.         ACSnet    pmiller@pdact.pd.necisa.oz
  870. /\/\*        CSNET    pmiller@pdact.pd.necisa.oz.au
  871. Disclaimer:  The views expressed here are personal and do not necessarily
  872.     reflect the view of my employer or the views or my colleagues.
  873.  
  874. "I have discovered that in this business you need animators,
  875. accountants and bookkeepers can't do it." - Walt Disney.
  876. 
  877. 
  878. Path: ucivax!gateway
  879. From: rsfinn@athena.mit.edu ("Russell S. Finn")
  880. Subject: Re: 020/881
  881. Message-ID: <9102070605.AA22585@e40-008-7.MIT.EDU>
  882. In-Reply-To: Peter Miller's message of 07 Feb 91 03:19:59 +0000.
  883.              <9102070112.AA05159@elm>
  884. Newsgroups: fa.think-c
  885. Lines: 14
  886. Date: 7 Feb 91 06:09:01 GMT
  887.  
  888. Peter writes:
  889. >Perhaps I could have asked the question
  890. >    "Why didn't apple do an FPU emulator, rather than SANE?"
  891.  
  892. Because SANE was invented before machines with 68020/68881 (in fact,
  893. it predates the Macintosh).  I don't think it was known at the time
  894. how the FPU interface would be defined (using F-line traps which have
  895. always been "reserved to Motorola").  I agree it would have been nice
  896. if it could have used the same interface, but it's too late now...
  897.  
  898. Disclaimer:  I was but a wee lad at the time myself...
  899.  
  900. -- Russ
  901. rsfinn@{athena,lcs}.mit.edu
  902. 
  903. 
  904. Path: ucivax!gateway
  905. From: dmac@eagle.mit.edu ("David S. McCormick")
  906. Subject: QuickDraw Gotcha: Never send a FrameArc to do a FrameOval's job
  907. Message-ID: <9102071931.AA25418@EAGLE.MIT.EDU>
  908. Newsgroups: fa.think-c
  909. Lines: 29
  910. Date: 7 Feb 91 19:34:37 GMT
  911.  
  912. This may seem stupid, but I was banging my head on this one for a week
  913. or so. I wrote earlier asking for I was having problems with writing
  914. into a PicHandle which included a call to FrameArc(). I was trying to
  915. make a circle with FrameArc() and it appeared in my scrolling window
  916. just fine, but did not appear when I saved the Picture to a CPictFile
  917. and opened it in Canvas. The call I used was:
  918.  
  919. FrameArc( &thePictRect, 0, 360);
  920.  
  921. As I was calling Symantec Tech Support, it finally dawned on me:
  922. FrameArc() computes the arc *MODULUS 360* so that effectively QuickDraw
  923. thinks I'm saying
  924.  
  925. FrameArc( &thePictRect, 0, 0);
  926.  
  927. and therefore Canvas saw nothing. I still don't understand why the arc
  928. appeared in my scrolling window in the first place. The bottom line is
  929. that if you use the pathologic case above, you will get nothing in your
  930. Pict file. Instead use
  931.  
  932. FrameOval( &thePictRect );
  933.  
  934. and away goes trouble, down the drain.
  935. Never send a FrameArc to do a FrameOval's job.
  936.  
  937. Cheers,
  938. David S. McCormick
  939. MIT-EAPS Geology
  940. dmac@eagle.mit.edu
  941. 
  942. 
  943. Path: ucivax!gateway
  944. From: ech@pegasus.attmail.COM
  945. Subject: Re: 020/881
  946. Original-From: attmail!pegasus!ech (Ned Horvath )
  947. Lines: 41
  948. Date: 7 Feb 91 20:05:59 GMT
  949. Message-Service: mail
  950. Message-ID: <9102071204.aa09484@ICS.UCI.EDU>
  951. In-Reply-To: your message <internet0380140410> of Wed Feb 6 22:35:08 GMT 1991
  952. >To: internet!ics.uci.edu!think-c
  953. Content-Type: Text
  954. Content-Length: 2383
  955. Newsgroups: fa.think-c
  956. Message-Version: 2
  957. EMail-Version: 2
  958. UA-Message-ID: <MAC-1.3.4A1-618034-ech-822>
  959. UA-Content-ID: <PMX-PC-2.01A-000146-pegasus3-ech-1045>
  960. MTS-Message-ID: <pegasus0381509510>
  961.  
  962. I had written:
  963. OK, on the soapbox: Floating Point is for quick knockoffs and programmers with
  964. weak minds: you (almost) always can do a given job using much less expensive
  965. fixed-point arithmetic: use integers, but with the binary point somewhere
  966. other than the extreme right.  T'ain't hard, but fixed point does require that
  967. you understand the problem domain well, and that the "domain of discourse" is
  968. only a few orders of magnitude in size, but that describes almost all problems
  969. where FP is used.  A couple of good commercial examples are MacSwivel and
  970. MacSpin, neither of which use floating point to do some pretty magical things,
  971. and they run with good pace even on a Mac Plus.  Standing down from soapbox...
  972.  
  973. Bob Murphy (bobert@autodesk.com) replied:
  974. I disagree completely.  There is some truth in what Ned says about when
  975. you might be able to apply fixed point math, but he is just flat wrong
  976. when he says that such situations encompass "almost all problems where
  977. FP is used".  You can begin by removing from "almost all problems" a
  978. huge chunk of CAD, especially 3-D, and also much of scientific computing.
  979. I work in both problem domains, and I don't use floating point because
  980. I'm lazy or stupid - I use them because nothing else would work.
  981. --------- End of Original Message ---------
  982.  
  983. Thanks for the followup, Bob, no insult intended.  My caveat included "only a
  984. few orders of magnitude" in the problem domain, and I'll certainly concede
  985. that there are cases where very large and very small numbers get mixed up.
  986. An example: the nature of a semiconductor is determined by p-type or n-type
  987. impurities which comprise on the order of 1E-8 of the sample.  There are too
  988. many orders of magnitude between the largest and smallest numbers for fixed
  989. point to be effective.  Playing with fractals is another -- one sets the
  990. "fractalscope" on many different orders of resolution, and floating point is
  991. the right way to go.
  992.  
  993. I also mentioned knock-offs.  When you need an answer in a hurry, floating
  994. point allows you to avoid (to some extent) acquiring an intimate knowledge of
  995. the problem space.
  996.  
  997. But at least consider fixed point for the cases in between.  EVERY 680x0 (and
  998. every whatzit86, for that matter) "knows" how to do fixed point arithmetic
  999. efficiently and without extra coprocessors.  For production programs where
  1000. it's applicable, it's an elegant way to go.
  1001.  
  1002. =Ned Horvath=
  1003. 
  1004. 
  1005. Path: ucivax!gateway
  1006. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  1007. Subject: re: MacsBug's Bugs & TCL
  1008. Message-ID: <9102072159.AA06955@neuromancer>
  1009. Newsgroups: fa.think-c
  1010. Lines: 15
  1011. Date: 8 Feb 91 18:08:35 GMT
  1012.  
  1013. followup:  I just found MacsBug 6.2b3 on AppleLink last night.
  1014.  
  1015.  
  1016. Runs great on a IIfx.  Nice new features for debugging objects, but they appear to be for
  1017.  
  1018. C++ & Object Pascal, not TCL, unless I'm mistaken.  I know they wrote the original
  1019. MacsBug downstairs in my building, but the Moto source is a bit out of date :-)
  1020.  
  1021. Has anybody here worked on a TCL-specific monitor?
  1022.  
  1023. I regret that the MacsBug problem wasn't quite related to this forum, but it did make
  1024. debugging a stack problem in a ThC application rather unbearable.
  1025.  
  1026. By the way, does anybody here have a copy of the Monkey desk accessory?  I've
  1027. misplaced it...
  1028. 
  1029. 
  1030. Path: ucivax!gateway
  1031. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  1032. Subject: re: 020/881
  1033. Message-ID: <9102072148.AA06948@neuromancer>
  1034. Newsgroups: fa.think-c
  1035. Lines: 71
  1036. Next-Attachment: .tar.939.re__020_881.attach, 4222, 1/1, 5808, 0
  1037. Date: 8 Feb 91 18:08:55 GMT
  1038.  
  1039. begin 0 .tar.939.re__020_881.attach
  1040. M'YV0:=R0*8/'A1PZ9@`H7,BPH<.'$"-*G$BQ(HB+-FC0``'@XD49-3AZ!!%#
  1041. MALB1%VG8F'$CY8T:-&;0@%G#AL<:-V;4Z%BQI\^?0(,*'4JTJ-&C2),J7;IT
  1042. M#Y>#9F!P">-F3AJG9MZXH4-'#!LN4<'.N9-FSAP02,JPL5.&3IHQ87;T4<"E
  1043. M31@Y9]B4A$'7+EXY>Q5@E6IFC@P:8--(9:.82YRO9^2$R0,#1)TZ;MJ&4/-&
  1044. MC-8R+IJT#0,'S1LY+H8\:1*B3)LS(%`T2;.F#(@C<LJ4<1/F3A@V=%*`N",G
  1045. M#9TR<W1P4>##R1L6(-P\C_[&Q<4L;^J`@%.'#@@Z:&RS>?,&3D#88[32D?.&
  1046. MS=DD3J8D(5+D>W@0Z0>"R#TGNYPQH%V$`A7WC5=>>ENQYQX(R_E`&AQEW/4=
  1047. M60"Z(!P(!-HVT!AEI:$5"!_N9D<:[+G1QF[>E06"7?IIQ48>(+H!('39T6'5
  1048. M0`V")QYY<+C08(-3O'&B9V3`"$=N(V8WQXLQVJ<B>+F%008(<]1QQAG('3=E
  1049. M'5:Y@=X;^O'G'X!S6(<A&F%X9Q>,IS6X)G7>B6&;CB#(.8=WOL%(QQL@G%'=
  1050. M14.`:9N8=?R'W'!IL,$&"&BR1:60MO6VAF]RD)&96<@U&(99;W"89AE3IF&&
  1051. M?67`F)L99>0FHVUY=?;;'-"U-8:928R:!*-2.GG6D9VQX1H(M]Z1'1MD,%8;
  1052. MD\09-Z>P##)G7AED@CAJ?K:-P>6>;:2A!ZC?\4DG?Q".X9:C(I*HU8E;G85"
  1053. MA&.@T:"P=1"+JZ/&G?7&'6Y$%\:)*4#'G7<ZM@%"0""0(2JJJGHW1QEGH&LC
  1054. M=#KFFR:IW<+A*UN+OC$JG9K"8?%;:7J8[T#'R9%M9L.A\18:()1;HL/`SANI
  1055. M0-MU!\)=92"\&X#=4OP@>T>F\6FS/IB!F;@B#[P5GV'T.9X8OVWW1D`EFYEA
  1056. MOD$PP4258BP<1QTH[I=SJCL?NB?%1LOHUH?PRBMG@R,V#=[$<$R]5:K0435E
  1057. ML,-:6@9;<LA\LW0Z!HZ@P6OSMNB=G\*\Z1KGW>R9S6WDT:#+YZ+H(UT*))$O
  1058. M@4-`ET=V)TSY*I\&+OQHH3Q?K%;!98AA99TP<AGYPG#<-32U8O?'.G)F!N$&
  1059. MC'Z"B>L8:]S,'F93SDW'#]`OM]RMQLYY7]I(?U@WU:D./%`89F)71^E4NJ6H
  1060. MX'0PB[ONQX'`QEU8;I<&M(=JC)^@/=M%=1@!0<RT'5.;$D'6TS0Y8,8M)P(!
  1061. M]A*'G]^X9W/3L]5PR#:<XKC%2VAKSWC(@D'`6>5#]KO">?0`G2KE!CK&&4[?
  1062. MML,>J'D%1G*ZGQQR(RZKA:$V%$-@&:!#!CZE,#TSA!8=7@0=-5S+?;2Q30H7
  1063. MI@>E@:`)8>#0TN;`,M,PR3-O6$.9I*<`(=B,8)436]2$)0=B0><.93B!H_P$
  1064. M,#[Q:D]TR`.$[C<0'L9N=G0:2!NF$[$5W5")WC&@Q,YBADUY9U-2,TL:O&*;
  1065. M#S6-+&&B2OSL9Y=V!01X7+R"AK1R`N\TRC:[R<X96*9#$`5N#E0QCI'L9J/\
  1066. M\6\KKU3@:2;$I_5)IGT>%)F]IH4_,A0J<@4D31JF],8WQ-$\&,Q95@X2/!",
  1067. MB&='0LXPP^:;=-T,=GOLF2"1.,KCN"%RA;Q3DYJ6A"1PR)3`JA4>H".[0U+I
  1068. M-\BQ2[Z,*$XTG>5LGZ08*A-(J4,)\IL8=*34#A(&1M*R8),Y2QC,4#**60$*
  1069. MV.33+-6B.L:@"E'G`]"F0,/%(`T,3RN,X3=Y=C;]P9)@3W!"?7QG*&>FZH/Y
  1070. M(@MX0"`"40W$#"(H7^-0=,]:RK1=+.P4<OH3N(%`2"!A"PAC4+:IA;7AA1`+
  1071. MS^>N\(2@JD&(A)PEZ%*V,L$9S`PZV\K]VF`>7P6N/(F#U>":=Y_TD#51W:-B
  1072. M2&TS![]X)Y16(B6?L)296VHH9Y?LJ=BBN3"QUFNL92U#"TJ)5EU"4`%/X&6A
  1073. M%D8C."!06R'[T#+/-`05QFM*_5E+I-QG3&GIBITV(]S-,KK1+7*.0%31(@A:
  1074. MP,7<I6=S+<@M;3MW-SEDA@XZ2(!MWP"$S!1*2%0!$&KF`(<R[9$.+G#K<H+@
  1075. M,5\Q(2!K"*X3TH0F-\B`BTXHPW'GP*&R@<`$(!@"B:QU6"`\T9BG:4\8H..Y
  1076. M64WW6OW#$$$V!9TJ3"$(7$3!&%(0@QSD``;0@0(6G&"=*=1!#%<55\^@\&#&
  1077. MC`$$3.@-"`S<@AK```=F$H(*A!`"$,QE+DQ)L8I7S.(6N_C%,(ZQC&=,XQK;
  1078. M^,8XSK&.=\SC'OOXQT`.<HT#,I""0$7(+_9(1C;2$8^`Y"07*0F41Z(2EK@$
  1079. M)C*AB4TN@A.=\`3)8`ZSF,=,9H8X!2I2H8I5L**>KGPE+(4ABUG0HA:VN`4N
  1080. M<ND+_/0B`[[4!7Z`Z;-@P$(8PR#&#(UAC%0>PX7(3*8RE_GM9CKSF=",IC2G
  1081. M2<UJ6O.:V,P&A[C1#6]\`QSA).LXR6F0<Z`C'5;_"03BJQG`"L2CR"%H/>UY
  1082. M3WSF4Q\Z\8Y0AC+3@&A](/4HZ"P=@Y"$TO<6T%PH0[#C$$R;A#D3)?4L+&JD
  1083. M&YBDE1F!J#LW*D..B-VC'S$G2$,"DY&0Y"$N<3M?X'D2&J($6BMAZ4[<LAT&
  1084. M?XV<,0'O(K!5TV1,Z::!JS:&=+(3G@9^-C^9*5!AZO?OSD*6\^6S/PF4%*7\
  1085. MAJDY:(I3GM+2P#86'E.-354\:Q74W!,K.LSJ(K6*&9K8JB)>,5)@?/ML]9!E
  1086. MP67QJ4'/BI;]>&>M.PE)6]PZV[>0$ZYQ@=(-(WH93V/#+G<QIVU3RN=A[Y4O
  1087. MWO#+7S8+F!._&E:%,<QA:NWCQ.BT)XO][77VXQAS'F3AS(ZL+:DZF6WNH#*@
  1088. M5AMFM\JGWF2MO).;5^GW^5EYBC.T!BTP:51CFM-<M:CM]=9J4@5!UK;V8*^!
  1089. M3:RG(MNJ!$NGQ[-MKG`3FGWHQDJ\K35F6,\,X`1'%6.&QW!:09S(HL:XXSAN
  1090. M#I##8$%KM"++,>?OFN.BYS@K.M*9SCVH(X_J6-JZMR]J(+*#C1AJUR78V')W
  1091. M^`,VF8(WO#Z1)^M13-Y=LD,SYT'O!\I'(@Y+?S0&6KZATP3?=9Q?OD0M*I_I
  1092. M4TMED#M^Y3[P8QM!5S^\I!\E]4IT\$K^<S,`-$PM@P<$M!\'E`8)9'KY`A>*
  1093. MXEH1!'L4=&J14WH:="^1DTL@-"HBY"4D1"6%LD,?Y5GR8G,%=475<AHT!%T`
  1094. M]T<YI($RV$,S"$0[2$0@0$_>43TSR$1.!$52M"=4Q"CM`4/DH46/Y44IDB]A
  1095. M%"6+0D9F-$%JQ"JE=3;%=$PY6$>PDWT4HT=\E'EV@4,IM$V(%$Z'M"MOH$@&
  1096. M)5"0-"B2U$BC4DDJ<RF/I4D%PTF>%`;D(AUY]1U`B$ZH]$UQ)#54(U@F]8`$
  1097. MLUD!2"4#R#ZVH8)585J\XTO%(7S[(4S$Q!YP)$>1HTRGP8.:YTS-QD+2-!!B
  1098. M54VMU#1LJ$V8P4UHX$W@9$CCE$[G-$OE9`;K5"<VTS2HY"MU115'>$3VU#,`
  1099. M>!_[M'<X<Q;_%#D"53<$95"92`8)=3,,U3UT\E`1A4X4)1ZBLG?^AQ\1LC"/
  1100. MY5$IA'5U8ALC-2=\4HFQE%(KY6\N)0?3)E,L4U-F<%,YU7NN,75G,Q;&`52\
  1101. M0B9$!3M'18M9N%21@BE/981]1`549558)4N!LU5\UU7Y1':BYQUNE5AG95FZ
  1102. ME#?MUU9"HI)48AJ?58]48E<MHXBCU#-\E2I#<U.!I4T#R!])U4HI"5>+U8B-
  1103. MI14@"%F2!9`RV%C9H@=V!Y*<18.@U1Z.TC3CX1UQIS)JU4YPLEJ+`A<+TY2P
  1104. MY0:RM5O+,5RXI5O3TUN_%5S#55SBQ1[RI%PNP%S.94S1)23355UE<%UJJ5W<
  1105. M117?Q3GA-5[EM2KGE5[K50?M]5Y[HB#S!2PRLCE!@%]N`!U4L%]JY5\`QCD"
  1106. M1F`&AF`@H&`,!@(.!F%"-&$5]A88IF$<YF$@=A$B1F(FI@`H5F:^^9O`&9S"
  1107. 1.9S$69S&>9S(F9S*N9S,"1$5
  1108. `
  1109. end
  1110. 
  1111. 
  1112. Path: ucivax!gateway
  1113. From: dmac@eagle.mit.edu ("David S. McCormick")
  1114. Subject: Need Help reading Picture from PictFile to Window
  1115. Message-ID: <9102090214.AA11004@EAGLE.MIT.EDU>
  1116. Newsgroups: fa.think-c
  1117. Lines: 151
  1118. Date: 9 Feb 91 02:16:59 GMT
  1119.  
  1120. I am unable to get a CPicture that was written to a CPictFile to be
  1121. displayed when I load the picture. The CPicture is NOT a resource, but
  1122. just a straight picture. The PictFile is OK because I can view it in
  1123. Canvas. I have a CPictDisplayWindow that is sent a PicHandle from a
  1124. CPictDisplayDoc. The instance variables of the thePicture are OK (at
  1125. least the bounds of the Picture are set to the correct size), but I
  1126. can't get the thing to appear in my scrolling window.
  1127. Here is my window class.
  1128.  
  1129. /* CPictDisplayWindow.h -- window class */
  1130. #define _H_CPictDisplayWindow
  1131.  
  1132. #include <CBureaucrat.h>
  1133. #include <CDirector.h>
  1134. #include <CPane.h>
  1135. #include <CPicture.h>
  1136. #include <CScrollPane.h>
  1137. #include <CWindow.h>
  1138.  
  1139. struct CPictDisplayWindow : CWindow {
  1140.     CPane            *itsMainPane;
  1141.     CBureaucrat        *itsGopher;
  1142.     CScrollPane        *mainScroll;
  1143.     CPicture        *itsPicture;
  1144.     /*----------*/
  1145.     void        IPictDisplayWindow    (CDirector    *aSupervisor);
  1146.     void        Activate    (void);
  1147.     void         DoCommand    (long        theCommand);
  1148.     void        SetPicture    (PicHandle    thePicHandle);
  1149.     PicHandle    GetPicture    (void);
  1150. };
  1151.  
  1152. /* CPictDisplayWindow.c -- window methods */
  1153. #include <Commands.h>
  1154. #include <Constants.h>
  1155. #include <Global.h>
  1156. #include <CDecorator.h>
  1157. #include <CDesktop.h>
  1158. #include <CError.h>
  1159. #include <CRadioGroup.h>
  1160. #include <CSizeBox.h>
  1161. #include <TBUtilities.h>
  1162.  
  1163. #include "CPictDisplayWindow.h"
  1164.  
  1165. /*### REQUIREMENTS FOR THE WINDOW RESOURCE
  1166.     you must create a WIND resource with the following resID number
  1167.         it should be a zoomDocProc window (close box, zoom box, scroll bars)
  1168. ###*/
  1169. static int    kPictDisplayWindID = 20000;
  1170.                     /* number of pixels scrolled per click on scroll bar */
  1171. static int    kScrollPixels     = 10;
  1172.  
  1173. extern    CDecorator        *gDecorator;    /* Window dressing object    */
  1174. extern    CDesktop        *gDesktop;        /* The enclosure for all windows */
  1175. extern    CError            *gError;        /* The error handling object */
  1176. extern    CBureaucrat        *gGopher;        /* The current boss in the chain of
  1177. command */
  1178.  
  1179. /*----------*/
  1180. void    CPictDisplayWindow::IPictDisplayWindow    (CDirector    *aSupervisor)
  1181. {
  1182.     CView            *enclosure;
  1183.     CBureaucrat        *supervisor;
  1184.     CSizeBox        *aSizeBox;
  1185.     CRadioGroup        *aGroup;
  1186.     CScrollPane        *theScrollPane;
  1187.     CPicture        *thePicture;
  1188.  
  1189.     IWindow (kPictDisplayWindID, FALSE, gDesktop, aSupervisor);
  1190.     itsMainPane = NULL;
  1191.     itsGopher = aSupervisor;
  1192.     enclosure = this;
  1193.     supervisor = this;
  1194.  
  1195.     aSizeBox = new (CSizeBox);
  1196.     aSizeBox->ISizeBox (enclosure, supervisor);
  1197.  
  1198.     theScrollPane = new( CScrollPane );
  1199.     theScrollPane->IScrollPane(    this, aSupervisor,
  1200.                                 0, 0, 0, 0,
  1201.                                 sizELASTIC, sizELASTIC,
  1202.                                 TRUE, TRUE, TRUE );
  1203.  
  1204.     theScrollPane->FitToEnclFrame( TRUE, TRUE );
  1205.     theScrollPane->SetSteps( kScrollPixels, kScrollPixels );
  1206.  
  1207.     thePicture = new( CPicture );
  1208.     thePicture->IPicture( theScrollPane, aSupervisor,
  1209.                             0, 0, 0, 0,
  1210.                             sizELASTIC, sizELASTIC );
  1211.  
  1212.     /* make the itsPicture the entire available space within the PlotWindow
  1213. */
  1214.     thePicture->FitToEnclosure( TRUE, TRUE );
  1215.     theScrollPane->InstallPanorama( thePicture );
  1216.  
  1217.     mainScroll = theScrollPane;
  1218.     itsPicture = thePicture;
  1219.     itsMainPane = itsPicture;
  1220.     itsGopher = itsPicture;
  1221. } /* IPlotWindow */
  1222.  
  1223. /*----------*/
  1224. void CPictDisplayWindow::Activate        (void)
  1225. {
  1226.     inherited::Activate ();
  1227.     gGopher = itsGopher;
  1228. } /* Activate */
  1229.  
  1230. /*----------*/
  1231. void CPictDisplayWindow::DoCommand        (long        theCommand)
  1232. {
  1233.     switch (theCommand) {
  1234.         default:
  1235.                 inherited::DoCommand (theCommand);
  1236.             break;
  1237.     } /* switch */
  1238.  
  1239. } /* DoCommand */
  1240.  
  1241. /*----------*/
  1242. void        CPictDisplayWindow::SetPicture    (PicHandle    thePicHandle)
  1243. {
  1244.     itsPicture->SetMacPicture( thePicHandle );
  1245.     if (mainScroll != NULL) {
  1246.         mainScroll->AdjustScrollMax();
  1247.     }
  1248.     itsMainPane->Prepare();
  1249.     itsMainPane->Refresh();
  1250. } /* SetPicture */
  1251.  
  1252. /*----------*/
  1253. PicHandle    CPictDisplayWindow::GetPicture    (void)
  1254. {
  1255.     return ( itsPicture->GetMacPicture() );
  1256. } /* GetPicture */
  1257.  
  1258. /* CPictDisplayWindow.c */
  1259.  
  1260.  
  1261. Any ideas? Thanks in advance.
  1262.  
  1263. Cheers,
  1264. David S. McCormick
  1265. MIT-EAPS Geology
  1266. Bldg. 54-1016
  1267. Cambridge, MA 02139
  1268. 617-253-9852
  1269. dmac@eagle.mit.edu
  1270. CompuServe: 71540,2765
  1271. 
  1272. 
  1273. Path: ucivax!gateway
  1274. From: minow@bolt.enet.dec.COM ("Martin Minow, ML3-5/U26  09-Feb-1991 0927")
  1275. Subject: re: getting a picture
  1276. Message-ID: <9102091520.AA11665@decpa.pa.dec.com>
  1277. Newsgroups: fa.think-c
  1278. Lines: 21
  1279. Date: 9 Feb 91 15:25:01 GMT
  1280.  
  1281. dmc@eagle writes:
  1282. >I am unable to get a CPicture that was written to a CPictFile to be
  1283. >displayed when I load the picture. The CPicture is NOT a resource, but
  1284. ...
  1285.      itsMainPane = itsPicture;
  1286.  
  1287. I wonder whether itsMainPane ought to be the CScrollPane that you created.
  1288.  
  1289. By the way, why didn't you write this as a CDocument class (then the
  1290. file would point to your PICT file)?  There may be some magic in CDocument
  1291. that you're not doing.  Have you poked around the PICT handle after it
  1292. was read in?  (It was read in, right?)
  1293.  
  1294. My gut feel about TCL (as of this instant), is that it's best to keep
  1295. visual classes (CWindow, CPane, etc) separate from data classes (CPicture),
  1296. linking them together with methods like InstallPanorama and the occassional
  1297. instance variable or instance list (like itsMainPane and itsSubViews).
  1298.  
  1299. Good luck.
  1300.  
  1301. Martin.
  1302. 
  1303. 
  1304. Path: ucivax!gateway
  1305. From: minow@bolt.enet.dec.COM ("Martin Minow, ML3-5/U26  09-Feb-1991 2039")
  1306. Subject: Another CPicture example
  1307. Message-ID: <9102100143.AA29203@decpa.pa.dec.com>
  1308. Newsgroups: fa.think-c
  1309. Lines: 54
  1310. Date: 10 Feb 91 01:48:44 GMT
  1311.  
  1312. Here's an example (edited from newly-working code) that shows how
  1313. to create a Pict Panorama and load it from a file.
  1314.  
  1315. Martin Minow
  1316. minow@bolt.enet.dec.com
  1317.  
  1318. /*
  1319.  * Call this (first) to create a CPicture that fills itsMainPane.
  1320.  */
  1321. void
  1322. MyMainPane::CreatePicture()
  1323. {
  1324.     itsPicture = new(CPicture);
  1325.     itsPicture->IPicture(
  1326.         itsMainPane,
  1327.         this,
  1328.         0, 0, 0, 0,
  1329.         sizELASTIC,
  1330.         sizELASTIC
  1331.     );
  1332.      itsPicture->FitToEnclFrame(TRUE, TRUE);
  1333.     itsPicture->SetScaled(TRUE);
  1334. }
  1335.  
  1336. /*
  1337.  * Then call this to read the Picture from a specified file.
  1338.  */
  1339. void
  1340. MyApp::ReadPict(
  1341.     Str255    pictFileName
  1342.     )
  1343. {
  1344.     CPictFile    *aFile;
  1345.     OSErr        status;
  1346.     Handle        aHandle;
  1347.  
  1348.     aFile = new(CPictFile);
  1349.     aFile->IPictFile();
  1350.     aFile->Specify(pictFileName, 0);    /* Current directory    */
  1351.     status = aFile->Open(fsRdPerm);
  1352.     if (gError->CheckOSError(status)) {
  1353.         status = aFile->ReadAll(&aHandle);
  1354.         if (gError->CheckOSError(status)) {
  1355.         itsPictHandle = (PicHandle) aHandle;
  1356.         myDoc
  1357.             ->myMainPane
  1358.             ->itsPicture
  1359.             ->SetMacPicture(itsPictHandle);
  1360.         }
  1361.         status = aFile->Close();
  1362.         gError->CheckOSError(status);
  1363.     }
  1364.     aFile->Dispose();
  1365. }
  1366. 
  1367. 
  1368. Path: ucivax!gateway
  1369. From: dmac@eagle.mit.edu ("David S. McCormick")
  1370. Subject: Last CPicture question: strange clipping of CPicture in ScrollPane
  1371. Message-ID: <9102100650.AA14273@EAGLE.MIT.EDU>
  1372. Newsgroups: fa.think-c
  1373. Lines: 71
  1374. Date: 10 Feb 91 06:53:11 GMT
  1375.  
  1376. I create a Picture in my program in a ScrollPane and write it to a Pict
  1377. file just fine. I can open it in Canvas and everything is ducky. I read
  1378. the Picture back into a window dedicated solely to the display of
  1379. Pictures. The bounds of the Picture is correct and the ScrollPane into
  1380. which the Picture is installed works just fine. The problem is that the
  1381. Pict image is clipped such that part of the image cannot be seen, even
  1382. though I can scroll over the entire bounds of the picture. The visible
  1383. area corresponds to the clipped area of the original window in which it
  1384. was drawn just before it was saved to the PictFile. There is some
  1385. ClipRect that is not getting reset? Is the aperture of my Picture not
  1386. being reset? Is this information stored in the PictFile? What am I
  1387. missing here?
  1388.  
  1389. The following is the window initalization routine.
  1390.  
  1391. /*----------*/
  1392. void    CPictDisplayWindow::IPictDisplayWindow    (
  1393.     CDirector    *aSupervisor,
  1394.     PicHandle    thePicHandle)
  1395. {
  1396.     CView            *enclosure;
  1397.     CBureaucrat        *supervisor;
  1398.     CSizeBox        *aSizeBox;
  1399.     CRadioGroup        *aGroup;
  1400.     CScrollPane        *theScrollPane;
  1401.     CPicture        *thePicture;
  1402.  
  1403.     IWindow (kPictDisplayWindID, FALSE, gDesktop, aSupervisor);
  1404.     enclosure = this;
  1405.     supervisor = this;
  1406.  
  1407.     aSizeBox = new (CSizeBox);
  1408.     aSizeBox->ISizeBox (enclosure, supervisor);
  1409.  
  1410.     theScrollPane = new( CScrollPane );
  1411.     theScrollPane->IScrollPane(    this, aSupervisor,
  1412.                                 0, 0, 0, 0,
  1413.                                 sizELASTIC, sizELASTIC,
  1414.                                 TRUE, TRUE, TRUE );
  1415.  
  1416.     theScrollPane->FitToEnclFrame( TRUE, TRUE );
  1417.  
  1418.     theScrollPane->SetSteps( kScrollSteps, kScrollSteps );
  1419.  
  1420.     thePicture = new( CPicture );
  1421.     thePicture->IPicture( theScrollPane, aSupervisor,
  1422.                             0, 0, 0, 0,
  1423.                             sizELASTIC, sizELASTIC );
  1424.  
  1425.     thePicture->FitToEnclosure( TRUE, TRUE );
  1426.     thePicture->SetMacPicture( thePicHandle );
  1427.     theScrollPane->InstallPanorama( thePicture );
  1428.  
  1429.     mainScroll = theScrollPane;
  1430.     itsPicture = thePicture;
  1431.     itsMainPane = itsPicture;
  1432.     itsGopher = itsPicture;
  1433.  
  1434. } /* IPlotWindow */
  1435.  
  1436.  
  1437. Thanks everyone.
  1438.  
  1439. Cheers,
  1440. David S. McCormick
  1441. MIT-EAPS Geology
  1442. Bldg. 54-1016
  1443. Cambridge, MA 02139
  1444. 617-253-9852
  1445. dmac@eagle.mit.edu
  1446. CompuServe: 71540,2765
  1447. 
  1448. 
  1449. Path: ucivax!gateway
  1450. From: nagel@ICS.UCI.EDU (Mark Nagel)
  1451. Subject: ARCHIVE: 4+ version 1.4
  1452. Message-ID: <21956.666235590@ics.uci.edu>
  1453. Newsgroups: fa.think-c
  1454. Reply-To: nagel@ICS.UCI.EDU
  1455. Organization: University of California, Irvine - Dept of ICS
  1456. Lines: 31
  1457. Date: 11 Feb 91 01:28:47 GMT
  1458. Phone: (714) 856-5039
  1459.  
  1460. From: "David S. McCormick" <dmac@eagle.mit.EDU>
  1461. Date: Thu, 07 Feb 91 16:42:53
  1462. Subject: New version of 4Plus (v1.4) submitted to /incoming
  1463.  
  1464. I have uploaded a new version of 4Plus (v.1.4) to /incoming.
  1465. I have been using this version for 3 weeks on my SE/30 and have had no
  1466. problems; the author seems to have addressed many of the problems, and
  1467. even added some enhancements to the thing, like being able to access the
  1468. 'vers' resources right from the menu. More importantly, this version
  1469. appears to coexist peacefully with Windows INIT which alters the menu
  1470. bar; I remember that lots of people claimed to have had problems with
  1471. programs which altered the menu bar. I did notice that DiskDoubler INIT,
  1472. which inserts itself into the menu bar, did disappear when 4Plus
  1473. inserted itself on launch of ThinkC. I has not crashed by system. The
  1474. only problem I have noticed is it's coexistence with CMarker CDEF, the
  1475. one which does function parsing and allows fast comment/uncomment. It
  1476. works flawlessly with the function parser, but sometimes causes and
  1477. "Think C unexpectedly quit: Out of application memory" error. Again,
  1478. CMarker's function parser still works flawlessly. As 4Plus has a
  1479. function parser, you don't really need both. My guess is that there
  1480. could be problems with Think C extensions which live in ThinkC's heap. I
  1481. know that Kiss 1.7 is totally preempted by 4Plus. The Browser facility,
  1482. editor extensions, GREP extensions, and macro facilities are really
  1483. great, though. Again lots of conflicts seem to have been ironed out.
  1484.  
  1485. Cheers,
  1486. David S. McCormick
  1487. MIT-EAPS Geology
  1488. dmac@eagle.mit.edu
  1489.  
  1490. [saved as: /mac/think-c/compiler/4plus-14.hqx; 136K]
  1491. 
  1492. 
  1493. Path: ucivax!gateway
  1494. From: wolfgang_naegeli@qm01.ctd.ornl.GOV (Wolfgang Naegeli)
  1495. Subject: Re: ARCHIVE- 4+ version 1.4
  1496. Message-ID: <9102110613.aa03080@ICS.UCI.EDU>
  1497. Priority: Normal
  1498. Newsgroups: fa.think-c
  1499. Lines: 21
  1500. Date: 11 Feb 91 14:17:15 GMT
  1501.  
  1502.         Reply to:   RE>ARCHIVE: 4+ version 1.4
  1503. Mark Nagel writes:
  1504. > I did notice that DiskDoubler INIT, which inserts itself into the
  1505. > menu bar, did disappear when 4Plus inserted itself on launch of
  1506. > ThinkC. ...
  1507. The DD menu disappears regardless what application you launch, since it is only
  1508. active in the Finder.  Do you mean that after launching ThinkC with
  1509. 4Plus, DD is gone when you switch back to the Finder?
  1510.  
  1511. > It works flawlessly with the function parser, but sometimes
  1512. > causes and "Think C unexpectedly quit: Out of application
  1513. > memory" error.
  1514. Have you tried giving ThinkC more RAM under MultiFinder?
  1515.  
  1516. Wolfgang N. Naegeli
  1517. University of Tennessee & Oak Ridge National Laboratory
  1518. Internet: wnn@ornl.gov    Bitnet: wnn@ornlstc
  1519. Phone: 615-574-6143       Fax: 615-574-6141 (MacFax)
  1520. QuickMail (QM-QM): Wolfgang Naegeli @ 615-574-4510
  1521.  
  1522.  
  1523. 
  1524. 
  1525. Path: ucivax!gateway
  1526. From: dmac@eagle.mit.edu ("David S. McCormick")
  1527. Subject: Re: ARCHIVE- 4+ version 1.4
  1528. Message-ID: <9102111724.AA21836@EAGLE.MIT.EDU>
  1529. Newsgroups: fa.think-c
  1530. Lines: 10
  1531. Date: 11 Feb 91 17:27:53 GMT
  1532.  
  1533. I submitted the 4Plus archive. You are absolutely correct that
  1534. DiskDoubler is only present in Finder; there are no problems with DD
  1535. reappearing my mistake. As to the memory problem, it seems to happen
  1536. regardless of partition size, but I haven't persued it exhaustively.
  1537. Hope this clears it up. The new version is much better.
  1538.  
  1539. Cheers,
  1540. David S. McCormick
  1541. MIT-EAPS Geology
  1542. dmac@eagle.mit.edu
  1543. 
  1544. 
  1545. Path: ucivax!gateway
  1546. From: Tom_Johnson@chip.cs.ucla.edu (Tom Johnson)
  1547. Subject: ListMgr Replacement class
  1548. Message-ID: <9102111120.aa09236@ICS.UCI.EDU>
  1549. Newsgroups: fa.think-c
  1550. Lines: 11
  1551. Date: 11 Feb 91 19:22:56 GMT
  1552.  
  1553.                ListMgr Replacement class
  1554. I seem to remember a list manager replacement class floating by here sometime
  1555. in the past.  Unfortunately I seem to have accidently deleted my copy of it.
  1556. Could somebody please send me a copy?
  1557.  
  1558. Thanks-
  1559.  
  1560. Tom
  1561. tj@cs.ucla.edu
  1562.  
  1563.  
  1564. 
  1565. 
  1566. Path: ucivax!gateway
  1567. From: minow@bolt.enet.dec.COM ("Martin Minow, ML3-5/U26  11-Feb-1991 1436")
  1568. Subject: Proportionate scaling of CPictures
  1569. Message-ID: <9102111942.AA22023@decpa.pa.dec.com>
  1570. Newsgroups: fa.think-c
  1571. Lines: 19
  1572. Date: 11 Feb 91 19:45:30 GMT
  1573.  
  1574. Now, I can read a picture and display it in a panorama.  But, my picture
  1575. is 3x5 inches and the window (CPanorama) it's going into is 4x7 inches
  1576. (numbers invented). If I SetScaled(TRUE), the picture is squashed so it
  1577. fills the window; if I SetScaled(FALSE), the picture is the right size
  1578. and shape, but stuck up against the top-left corner.  (or, if my picture's
  1579. dimensions are larger than the panorama, only part of it shows).  Scrolling
  1580. is not an option.
  1581.  
  1582. The right solution is to scale both axes so the picture fills the frame
  1583. without distortion.  Anyone have a code segment lying around that does
  1584. this (obviously, I don't quite understand the relation between "bounds"
  1585. and "frame").
  1586.  
  1587. Thanks.
  1588.  
  1589. Martin.
  1590.  
  1591. ps: Hello Symantec -- may we hope for lots of tiny examples in the
  1592. next version of the TCL manual?
  1593. 
  1594. 
  1595. Path: ucivax!gateway
  1596. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  1597. Subject: CIdleChore.[hc] for sanity checks
  1598. Message-ID: <9102122159.AA08493@neuromancer>
  1599. Newsgroups: fa.think-c
  1600. Lines: 114
  1601. Date: 12 Feb 91 22:22:23 GMT
  1602.  
  1603. Hi Net,
  1604.  
  1605. I've been working on an idle time chore in TCL that performs sanity checking.  The code
  1606. below does NIL handle/pointer reference sniffing by looking at the zero location in memory
  1607. and maintaining a value that will trigger "odd address error" on 68000 class Macs and
  1608. "bus error" on 020/030/040 class Macs.  I've used it for a few years, kudos to my friends at
  1609. what used to be Caldera Software, but David Dunham just talked about similar techniques
  1610. in the Feb '91 MacTutor.
  1611.  
  1612. Here's my code.  It seems to work fine.  I'll bet it may give some grief to Microsoft wares,
  1613. which I tend to not to use.  Note that you've got to reset the zero loc value whenever the
  1614. application resumes from a switch or a DA.  Other wares, such as Control Panel's
  1615. "General" will tweek the same location.
  1616.  
  1617. Other "things" could be stuck in such a chore, eg. stack sniffing (although stack problems
  1618. happen deep in code, not in the event loop), fragmentation, etc.  I also use idle time
  1619. chores for updates to the screen that take more than 1/10 sec to calculate on a slow
  1620. machine, eg. celestial mechanics, etc., and for throwing occaisional animation surprises.
  1621.  
  1622. Does anybody have other types of idle time sanity checking they could share??
  1623. Thanks -
  1624.  
  1625.     paco.
  1626. ----
  1627. Internet:        paco@neuromancer.sps.mot.com
  1628. AppleLink:        Nathan2
  1629. Voice Mail:        1.512.891.2973
  1630. CompuServe:        74020,2145
  1631.  
  1632. Neural Networks & Virtual Reality Development
  1633. CECT, Motorola, Inc., Austin, Texas, Gaia
  1634. (c)1991, PXN. Subject to Public Law 99-508.  B*B!
  1635.  
  1636.  
  1637.  
  1638. /********** snip, snip to: CIdleChore.h *********************************/
  1639. /****
  1640.  * CIdleChore.h
  1641.  *
  1642.  *    TCL Chore class for an idle time sanity checking.
  1643.  *
  1644.  *    Public Domain Software from Motorola, Inc.
  1645.  *    910208 Paco Xander Nathan
  1646.  *
  1647.  ****/
  1648.  
  1649. #define _H_CIdleChore
  1650. #include <CChore.h>
  1651.  
  1652. /*** Public Data Definitions
  1653.  ***/
  1654.  
  1655. #define BOZO_NONO    0xF0F0F1
  1656.  
  1657.  
  1658. struct CIdleChore : CChore {
  1659.     void    Perform(long *maxSleep);
  1660. };
  1661.  
  1662.  
  1663. /********** snip, snip to: CIdleChore.c *********************************/
  1664. /****
  1665.  * CIdleChore.c
  1666.  *
  1667.  *    TCL Chore methods for an idle time sanity checking.
  1668.  *
  1669.  *    Public Domain Software from Motorola, Inc.
  1670.  *    910208 Paco Xander Nathan
  1671.  *
  1672.  ****/
  1673.  
  1674. #include "CIdleChore.h"
  1675.  
  1676.  
  1677. /***
  1678.  * Perform -- OVERRIDE
  1679.  *
  1680.  ***/
  1681.  
  1682. void CIdleChore::Perform(long *maxSleep)
  1683. {
  1684.     register unsigned long    *zero;
  1685.  
  1686.     zero = NULL;
  1687.  
  1688.     if (*zero != BOZO_NONO) {
  1689.         gError->SevereMacError(memAdrErr);
  1690.         *zero = BOZO_NONO;
  1691.     }
  1692.  
  1693.     /* insert other fun tasks here ... */
  1694.  
  1695.     *maxSleep = 20L;
  1696. }
  1697.  
  1698.  
  1699. /********** snip, snip patches to: CYourApp.c *********************************/
  1700.  
  1701. /* somewhere in CYourApp::IYourApp() */
  1702.  
  1703. #include "CIdleChore.h"
  1704.  
  1705.     register unsigned long    *zero;
  1706.  
  1707.     *zero = NULL;
  1708.     zero = BOZO_NONO;
  1709.     AssignIdleChore(new(CIdleChore));
  1710.  
  1711. /* somewhere in CYourApp::Resume() */
  1712.  
  1713.     register unsigned long    *zero;
  1714.  
  1715.     *zero = NULL;
  1716.     zero = BOZO_NONO;
  1717. 
  1718. 
  1719. Path: ucivax!gateway
  1720. From: dmac@eagle.mit.edu ("David S. McCormick")
  1721. Subject: How do color icons get used?
  1722. Message-ID: <9102132311.AA20928@EAGLE.MIT.EDU>
  1723. Newsgroups: fa.think-c
  1724. Lines: 10
  1725. Date: 13 Feb 91 23:14:27 GMT
  1726.  
  1727. I have used ResEdit 2.1 to create the proper BNDL resource for a B&W,
  1728. icl4 and icl8 in the Bundle editor window and I have created a 'cicn'
  1729. for my application. The color icons don't show up on the 8bit system I'm
  1730. using under sys 6.0.5. How does one get the color icon to appear on the
  1731. color systems and the b&w one on monchrome ones?
  1732. Thanks,
  1733. Cheers,
  1734. David S. McCormick
  1735. MIT-EAPS Geology
  1736. dmac@eagle.mit.edu
  1737. 
  1738. 
  1739. Path: ucivax!gateway
  1740. From: nick@lfcs.edinburgh.ac.UK (Nick Rothwell)
  1741. Subject: Re: CIdleChore.[hc] for sanity checks
  1742. Message-ID: <5149.9102141142@lfcs.ed.ac.uk>
  1743. Newsgroups: fa.think-c
  1744. Lines: 32
  1745. Date: 14 Feb 91 13:13:28 GMT
  1746.  
  1747. >/* somewhere in CYourApp::IYourApp() */
  1748. >
  1749. >#include "CIdleChore.h"
  1750. >
  1751. >    register unsigned long    *zero;
  1752. >
  1753. >    *zero = NULL;
  1754. >    zero = BOZO_NONO;
  1755. >    AssignIdleChore(new(CIdleChore));
  1756. >
  1757. >/* somewhere in CYourApp::Resume() */
  1758. >
  1759. >    register unsigned long    *zero;
  1760. >
  1761. >    *zero = NULL;
  1762. >    zero = BOZO_NONO;
  1763.  
  1764. This may be my imagination, but I think you have the `*' on the wrong line:
  1765. don't you want
  1766.  
  1767.         register unsigned long *zero = NULL;
  1768.         *zero = BOZO_NONO;
  1769.  
  1770. Also, I don't see why you bother to make it a register variable. But then,
  1771. I never use register variables anyway.
  1772.  
  1773. I ran a NilMinder VBL task for a while, but found that it causes crashes
  1774. with the TCL - perhaps the TCL uses the null location itself (or does its
  1775. own sanity checking).
  1776.  
  1777. Nick.
  1778.  
  1779. 
  1780. 
  1781. Path: ucivax!gateway
  1782. From: hataya@is.titech.ac.jp (Satoru Hataya)
  1783. Subject: include me in the mailing list
  1784. Message-ID: <9102141409.AA14830@titisa.is.titech.ac.jp>
  1785. Newsgroups: fa.think-c
  1786. Lines: 4
  1787. Date: 14 Feb 91 14:26:02 GMT
  1788.  
  1789.  
  1790. Please add me to the think-c mailing list.
  1791.                     Thanks,
  1792.                     satoru
  1793. 
  1794. 
  1795. Path: ucivax!gateway
  1796. From: dmac@eagle.mit.edu ("David S. McCormick")
  1797. Subject: Answers to my questions about color icons
  1798. Message-ID: <9102141740.AA26932@EAGLE.MIT.EDU>
  1799. Newsgroups: fa.think-c
  1800. Lines: 15
  1801. Date: 14 Feb 91 17:42:46 GMT
  1802.  
  1803. Thanks for all the rapid responses. The summary is as follows: no color
  1804. icons automatically until System 7.0.
  1805.  
  1806. " System 7.0 is the first version that
  1807. will do this [display color icons].  To do it in 6.0.*, you get an INIT
  1808. like ColorFinder, SunDesk, or Icon Colorizer (all are on Sumex), and put
  1809. your icon into the INIT file and reboot (or with IC, you just execute
  1810. the program, and it caches the icon -- it also works with other programs
  1811. that draw icons). "
  1812.  
  1813. Thanks one and all.
  1814. Cheers,
  1815. David S. McCormick
  1816. MIT-EAPS Geology
  1817. dmac@eagle.mit.edu
  1818. 
  1819. 
  1820. Path: ucivax!gateway
  1821. From: local%cirrusl@oliveb.atc.olivetti.COM ("local user(me")
  1822. Subject: ANSI libraries/stat call
  1823. Message-ID: <9102141916.AA26795@ss149.CIRRUSLOGIC.uucp>
  1824. Newsgroups: fa.think-c
  1825. Lines: 17
  1826. Date: 14 Feb 91 19:30:59 GMT
  1827.  
  1828. I was recently trying to port a Unix program ('patch', actually)
  1829. to Think C, and discovered then that the Unix library doesn't emulate either
  1830. the 'stat' routine or the 'access' routine, both of which are extremely
  1831.  common in Unix programs. I realize that there are ways of doing these things
  1832. with Mac system calls, but if I wanted to rewrite the whole program I wouldn't
  1833. be using the ANSI/unix libraries anyway. Does anyone know of a more complete
  1834. set of emulated Unix calls for Think C?
  1835.  
  1836. Failing that, has anyone seen anything like Larry Wall's 'patch' program
  1837. for the Mac? For those who don't know, it reads difference files and
  1838. merges the differences in the original programs.
  1839.  
  1840. -- Brian
  1841. ______________________________________________________
  1842. Brian Feinberg <brian%cirrusl@oliveb.ATC.olivetti.com>
  1843. UUCP:  oliveb!cirrusl!brian
  1844.  
  1845. 
  1846. 
  1847. Path: ucivax!gateway
  1848. From: paco@neuromancer.sps.mot.COM (Paco Xander Nathan)
  1849. Subject: Re: CIdleChore.[hc] for sanity checks
  1850. Message-ID: <9102142024.AA09093@neuromancer>
  1851. Newsgroups: fa.think-c
  1852. Lines: 16
  1853. Date: 14 Feb 91 23:07:39 GMT
  1854.  
  1855. Yeh, I meant:
  1856.  
  1857. >This may be my imagination, but I think you have the `*' on the wrong line:
  1858. >don't you want
  1859. >
  1860.  >       unsigned long *zero = NULL;
  1861.  >       *zero = BOZO_NONO;
  1862.  
  1863. I mailed off a NeXT & somebody sat on my kybd before I finished.  Register variables were
  1864. purely because I ripped off code.  Looking forward to an optimizing compiler someday for
  1865. ThC, anyway!
  1866.  
  1867. I haven't found any TCL use of the NIL location.
  1868.  
  1869.  
  1870. paco.
  1871. 
  1872. 
  1873. Path: ucivax!gateway
  1874. From: brian%cirrusl@oliveb.atc.olivetti.COM (Brian Feinberg)
  1875. Subject: ANSI libraries/stat call
  1876. Message-ID: <9102151724.AA06996@ss149.CIRRUSLOGIC.uucp>
  1877. Newsgroups: fa.think-c
  1878. Lines: 18
  1879. Date: 15 Feb 91 17:29:11 GMT
  1880.  
  1881. I was recently trying to port a Unix program ('patch', actually)
  1882. to Think C, and discovered then that the Unix library doesn't emulate either
  1883. the 'stat' routine or the 'access' routine, both of which are extremely
  1884.  common in Unix programs. I realize that there are ways of doing these things
  1885. with Mac system calls, but if I wanted to rewrite the whole program I wouldn't
  1886. be using the ANSI/unix libraries anyway. Does anyone know of a more complete
  1887. set of emulated Unix calls for Think C?
  1888.  
  1889. Failing that, has anyone seen anything like Larry Wall's 'patch' program
  1890. for the Mac? For those who don't know, it reads difference files and
  1891. merges the differences in the original programs.
  1892.  
  1893. -- Brian
  1894.  
  1895. ______________________________________________________
  1896. Brian Feinberg <brian%cirrusl@oliveb.ATC.olivetti.com>
  1897. UUCP:  oliveb!cirrusl!brian
  1898.  
  1899. 
  1900. 
  1901. Path: ucivax!gateway
  1902. From: nagel@ICS.UCI.EDU (Mark Nagel)
  1903. Subject: ARCHIVE: gnuucp 4.3
  1904. Message-ID: <29141.666641566@ics.uci.edu>
  1905. Newsgroups: fa.think-c
  1906. Reply-To: nagel@ICS.UCI.EDU
  1907. Organization: University of California, Irvine - Dept of ICS
  1908. Lines: 54
  1909. Date: 15 Feb 91 18:12:53 GMT
  1910. Phone: (714) 856-5039
  1911.  
  1912. From:    "James E. O'Dell" <jim@fpr.COM>
  1913. Date:    Thu, 14 Feb 91 22:35:09 EST
  1914. Subject: New Version of Mac/gnuucp
  1915.  
  1916. Mac/gnuucp from Fort Pond Research is a port of the GNU
  1917. version of the UUCP protocol to the Macintosh. In addition to the
  1918. UUCP transfer engine it also contains a HyperCard stack that is
  1919. used for both reading and sending mail to other users.
  1920.  
  1921. ==========Mac/gnuucp 4.3 Features==========
  1922.  
  1923. Double Clickable documents that launch Mac/gnuucp
  1924. to automatically call the named host.
  1925.  
  1926. Each Mac/gnuucp has their own HyperCard stack for reading
  1927. and replying to mail.
  1928.  
  1929. Mac/gnuucp automatically forwards mail to a "Well
  1930. Connected Host"
  1931.  
  1932. Mac/gnuucp supports local mailing lists.
  1933.  
  1934. The mailreader has an indexing capability that presents
  1935. a summary of all messages in the current mail stack.
  1936.  
  1937. Mac/gnuucp has been verified to communicate with
  1938. Vax VMS gnuucp, SUN uucp, Quickmail, and ATT SVR3
  1939. uucp servers
  1940.  
  1941. Mail messages are sent with standard RFC822
  1942. mail headers and dates.
  1943.  
  1944. Mac/gnuucp works with all Hayes compatible
  1945. modems
  1946.  
  1947. ==========================================
  1948.  
  1949. Registered users ($20) will be placed on the info-gnuucp
  1950. mailing list to be informed of updates, enhancements
  1951. as well as receiving communications regarding Mac/gnuucp
  1952. from other users.
  1953.  
  1954. As with all GNU programs source code is available and has been
  1955. distributed along with the binary form. If for any reason you want
  1956. the sources and cannot obtain them Fort Pond Research will supply
  1957. them for for a $20 copying fee.
  1958.  
  1959. Fort Pond Research
  1960. 15 Fort Pond Road
  1961. Acton, MA 01720
  1962. mac-gnuucp@fpr.com
  1963.  
  1964. [saved as: /mac/think-c/appl/gnuucp-43.hqx; 312K]
  1965. [saved as: /mac/think-c/appl/gnuucp-43-source.hqx; 576K]
  1966. 
  1967. 
  1968. Path: ucivax!gateway
  1969. From: minow@bolt.enet.dec.COM ("Martin Minow, ML3-5/U26  15-Feb-1991 1430")
  1970. Subject: Printing (without a window)?
  1971. Message-ID: <9102152045.AA04382@decpa.pa.dec.com>
  1972. Newsgroups: fa.think-c
  1973. Lines: 16
  1974. Date: 15 Feb 91 20:50:05 GMT
  1975.  
  1976. My application is coming along nicely (after a few false starts), and
  1977. I'm about to add printing.  The problem is that I'm not printing anything
  1978. in a window -- my "report" exists only on paper.  The kicker is that
  1979. CPane's need an enclosure which, ultimately, is a window.
  1980.  
  1981. According to the TCL support folk, I should create an off-screen window,
  1982. create the printing Panes in that, and then use the normal printing
  1983. methods.
  1984.  
  1985. I'm wondering of someone has found a more elegant solution: i.e., a
  1986. CGrafPort class or some-such.
  1987.  
  1988. Grateful for any and all help.
  1989.  
  1990. Martin.
  1991. minow@bolt.enet.dec.com
  1992. 
  1993. 
  1994. Path: ucivax!gateway
  1995. From: ECO8941@ecostat.aau.dk ("Povl H. Pedersen")
  1996. Subject: Re: Patch for Think C (Was: ANSI libraries/stat call)
  1997. Message-ID: <BB5CF2B2C61F01F512@vms2.uni-c.dk>
  1998. Newsgroups: fa.think-c
  1999. X-Vms-To: IN::"think-c@ics.uci.edu"
  2000. Lines: 8
  2001. Date: 15 Feb 91 22:52:38 GMT
  2002. X-Envelope-To: think-c@ics.uci.edu
  2003.  
  2004.  
  2005. There was some patch program in the 4.0 -> 4.02 upgrade package. It seems
  2006. to look very much like a normal patch file.
  2007.  
  2008. I guess we just need the documentation. Is SYMANTEC listening ?????
  2009.  
  2010. Povl H. Pedersen
  2011. eco8941@ecostat.aau.dk   /   hp48sx@wuarchive.wustl.edu
  2012. 
  2013. 
  2014. Path: ucivax!gateway
  2015. From: bootsie!olson@ICS.UCI.EDU ("Eric K. Olson")
  2016. Subject: Re: Patch for Think C
  2017. Message-ID: <9102160757.AA08596@bootsie.UUCP>
  2018. X-Mailer: Mail User's Shell (6.4 2/14/89)
  2019. Newsgroups: fa.think-c
  2020. Reply-To: olson@endor.harvard.edu
  2021. Lines: 26
  2022. Date: 16 Feb 91 08:09:50 GMT
  2023.  
  2024. In your message of Feb 15, 10:52pm, you write:
  2025. > There was some patch program in the 4.0 -> 4.02 upgrade package. It seems
  2026. > to look very much like a normal patch file.
  2027.  
  2028. The Weaver program takes a control file and a bunch of diff files.  The
  2029. diff files are MPW Compare output, from version 1 or 2 of MPW.
  2030.  
  2031. The diffs are not context sensitive (meaning they have some chance of
  2032. working even if you modified the original code).  I always assumed
  2033. unix patch was context sensistive, but I may be wrong (never use it...).
  2034.  
  2035. Cheers!
  2036.  
  2037. -Eric
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045. --
  2046. Eric K. Olson, Editor, Prepare()      NOTE:     olson@bootsie.uucp doesn't work
  2047. Lexington Software Design             Internet: olson@endor.harvard.edu
  2048. 72A Lowell St., Lexington, MA  02173  Uucp:     harvard!endor!olson
  2049. (617) 863-9624                        Bitnet:   OLSON@HARVARD
  2050. 
  2051. 
  2052. Path: ucivax!gateway
  2053. From: dce@krusty.smsc.sony.COM
  2054. Subject: Re: Patch for Think C
  2055. Message-ID: <9102161725.AA04906@sonyusa.Sony.COM>
  2056. In-Reply-To: Your message of 16 Feb 91 08:09:50 +0000.
  2057.              <9102160757.AA08596@bootsie.UUCP>
  2058. Content-Type: text
  2059. Content-Length: 1125
  2060. Newsgroups: fa.think-c
  2061. Lines: 26
  2062. Date: 16 Feb 91 17:38:30 GMT
  2063.  
  2064.  
  2065. >In your message of Feb 15, 10:52pm, you write:
  2066. >The Weaver program takes a control file and a bunch of diff files.  The
  2067. >diff files are MPW Compare output, from version 1 or 2 of MPW.
  2068. >
  2069. >The diffs are not context sensitive (meaning they have some chance of
  2070. >working even if you modified the original code).  I always assumed
  2071. >unix patch was context sensistive, but I may be wrong (never use it...).
  2072.  
  2073. The Unix patch program is context sensitive, but very smart if you give
  2074. it the right type of input.
  2075.  
  2076. If you supply a context diff (usually 3 added lines of context around
  2077. the change), it will locate the area and apply the patch.  It will
  2078. search around the target area just in case you added or deleted lines
  2079. above that area.
  2080.  
  2081. If it can't find the area, it won't try.  The assumption is that if
  2082. the area has changed enough that the context doesn't match, it's
  2083. very likely that the changes made in that area will conflict with
  2084. the patch.  In general, I've found that I prefer this behavior to
  2085. having patch go ahead and jam in the change.
  2086.  
  2087. ...David Elliott
  2088. ...dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce
  2089. ...(408)944-4073
  2090. 
  2091. 
  2092. Path: ucivax!gateway
  2093. From: brian%cirrusl@oliveb.atc.olivetti.COM (Brian Feinberg)
  2094. Subject: Patch program for Think C
  2095. Message-ID: <9102170426.AA12056@sunfire.>
  2096. Newsgroups: fa.think-c
  2097. Lines: 8
  2098. Date: 17 Feb 91 04:41:32 GMT
  2099.  
  2100. Since I was a bit unclear when I mentioned this before, I
  2101. should say that I meant I was trying to find a program to
  2102. apply Unix format patches to files. Since Autoweaver uses
  2103. its own file format, you can't use it to apply Unix diffs.
  2104. I'm just trying to apply some diffs I already have, and
  2105. would REALLY like to avoid either doing it by hand or
  2106. uploading everything to a Unix machine to patch, and then
  2107. downloading again.
  2108. 
  2109. 
  2110. Path: ucivax!gateway
  2111. From: siegel@das.harvard.edu (Rich Siegel)
  2112. Subject: Re:  Patch program for Think C
  2113. Message-ID: <9102170533.AA11429@endor.harvard.edu>
  2114. Newsgroups: fa.think-c
  2115. Lines: 4
  2116. Date: 17 Feb 91 05:37:36 GMT
  2117.  
  2118. AutoWeave uses files generated by the MPW Compare tool. It's a canonical format
  2119. so any diff program can be modified to emit this type of format.
  2120.  
  2121. R.
  2122. 
  2123. 
  2124. Path: ucivax!gateway
  2125. From: ehorvath@attmail.COM
  2126. Subject: Re: ARCHIVE: gnuucp 4.3
  2127. Original-From: attmail!ehorvath (Ned Horvath )
  2128. Lines: 19
  2129. Date: 19 Feb 91 23:13:52 GMT
  2130. Phone: +1 908 671 7100
  2131. Message-ID: <9102191508.aa25758@ICS.UCI.EDU>
  2132. In-Reply-To: your message <internet0462047370> of Fri Feb 15 18:12:53 GMT 1991
  2133. >To: internet!ics.uci.edu!think-c
  2134. Content-Type: text
  2135. Content-Length: 697
  2136. Newsgroups: fa.think-c
  2137. Message-Version: 2
  2138. EMail-Version: 2
  2139. UA-Message-ID: <MAC-1.3.2-618034-ehorvath-197>
  2140. UA-Content-ID: <MAC-1.3.2-618034-ehorvath-197>
  2141. MTS-Message-ID: <ehorvath0502209060>
  2142.  
  2143. ------------ Original Message -------------
  2144. From:    "James E. O'Dell" <jim@fpr.COM>
  2145. Date:    Thu, 14 Feb 91 22:35:09 EST
  2146. Subject: New Version of Mac/gnuucp
  2147. ...
  2148. [saved as: /mac/think-c/appl/gnuucp-43.hqx; 312K]
  2149. [saved as: /mac/think-c/appl/gnuucp-43-source.hqx; 576K]
  2150. --------- End of Original Message ---------
  2151.  
  2152. Please notice that the second package contains everything the first package
  2153. contains PLUS the source.  I wasted bandwidth (not to mention download time)
  2154. fetching both (mea culpa).
  2155.  
  2156. FYI, this release is quite an improvement over the previous (2.x) version.
  2157. Thanks to Jim O'Dell and his contributors for a job well done.
  2158.  
  2159. =Ned Horvath=
  2160. ehorvath@attmail.com
  2161. ehorvath@applelink.apple.com
  2162. 
  2163. 
  2164. Path: ucivax!gateway
  2165. From: jp48+@andrew.cmu.edu (Jonathan Pace)
  2166. Subject: Re: ARCHIVE: gnuucp 4.3
  2167. Message-ID: <kbkSZIa00WB8AInIFL@andrew.cmu.edu>
  2168. Newsgroups: fa.think-c
  2169. Lines: 3
  2170. Date: 20 Feb 91 03:17:12 GMT
  2171.  
  2172.    I'm new.  What is gnuucp?  Please post to the bboard - I'll read it.
  2173.  
  2174. Jon
  2175. 
  2176. 
  2177. Path: ucivax!gateway
  2178. From: ehorvath@attmail.COM
  2179. Subject: Re: what is gnuucp 4.3?
  2180. Original-From: attmail!ehorvath (Ned Horvath )
  2181. Lines: 29
  2182. Date: 20 Feb 91 04:51:19 GMT
  2183. Phone: +1 908 671 7100
  2184. Message-ID: <9102192049.aa08219@ICS.UCI.EDU>
  2185. In-Reply-To: your message <internet0510345470> of Wed Feb 20 03:17:12 GMT 1991
  2186. >To: internet!ics.uci.edu!think-c
  2187. Content-Type: text
  2188. Content-Length: 1435
  2189. Newsgroups: fa.think-c
  2190. Message-Version: 2
  2191. EMail-Version: 2
  2192. UA-Message-ID: <MAC-1.3.2-618034-ehorvath-212>
  2193. UA-Content-ID: <MAC-1.3.2-618034-ehorvath-212>
  2194. MTS-Message-ID: <ehorvath0510436380>
  2195.  
  2196. > I'm new.  What is gnuucp?  Please post to the bboard - I'll read it.
  2197.  
  2198. Briefly: Mac/gnuucp is a Mac application, written in Think C 4.x, which allows
  2199. your Mac+Hayes-compatible modem to behave like a uucp node, at least insofar
  2200. as sending and receiving mail is concerned.  The program will initiate calls
  2201. to deliver mail, and/or wait for calls.  To the remote unix machine you're
  2202. just another unix box -- even though you're running under the MacOS, not A/UX.
  2203.  
  2204. The package includes a HyperCard stack that allows you to originate mail, and
  2205. which will read your incoming mail as well.  Several different people can have
  2206. "mail files" on the same Mac.  Outgoing mail is placed where the uucp-emulator
  2207. will find it.
  2208.  
  2209. There's also extensive documentation -- if you've ever had to administer the
  2210. older (pre-HoneyDanBER) uucp, there's not much new.  If that's a new
  2211. experience, try to find someone who's been there, or tough it out.  You do
  2212. need the collusion of the administrator on your mail feed, who must add your
  2213. Mac as a uucp node.
  2214.  
  2215. The gnu, of course, is suggestive of the Free Software Foundation, and gnuucp
  2216. is distributed with source if you want it.  If you don't plan to dig into the
  2217. source, or you just want to hack the hypercard scripts, you don't need the
  2218. source.
  2219.  
  2220. Mail is about the only thing fully supported at this time.  Future development
  2221. may include news readers or additional protocols.
  2222.  
  2223. =Ned Horvath=
  2224. ehorvath@attmail.com
  2225. 
  2226. 
  2227. Path: ucivax!gateway
  2228. From: fri0@midway.uchicago.edu ("Christian E. Fritze")
  2229. Subject: TCL Dawdle() methods and sleep times
  2230. Message-ID: <CMM.0.88.667086246.fri0@quads.uchicago.edu>
  2231. Newsgroups: fa.think-c
  2232. Lines: 16
  2233. Date: 20 Feb 91 21:46:39 GMT
  2234.  
  2235. I have a Dawdle() method in a document which checks for certain conditions
  2236. when it is first called. Only if the conditions are TRUE are the guts of
  2237. the procedure entered, else the Dawdle() method returns immediately. If
  2238. the conditions are FALSE (and we bounce back out) I want the time until
  2239. this particular Dawdle() method is re-entered to be as short as possible.
  2240.  
  2241. The question is, how do I do this while giving enough time for other back-
  2242. ground tasks to perform necessary functions? Should I alter the maxSleep
  2243. parameter that is passed in? Change gSleepTime? Thanks for any help.
  2244.  
  2245.  
  2246.  
  2247. Christian E. Fritze                   |                            AOL:geneman
  2248. University of Chicago                 |               fri0@midway.uchicago.edu
  2249. Molecular Genetics and Cell Biology   |   "No one ever died of laughing" -M.B.
  2250. --
  2251. 
  2252. 
  2253. Path: ucivax!gateway
  2254. From: nagel@buckaroo.ICS.UCI.EDU (Mark Nagel)
  2255. Subject: ADMIN: About this list...
  2256. Message-ID: <22390.667106221@buckaroo.ics.uci.edu>
  2257. Newsgroups: fa.think-c
  2258. Reply-To: think-c-request@ICS.UCI.EDU
  2259. Organization: University of California, Irvine - Dept of ICS
  2260. Lines: 80
  2261. Date: 21 Feb 91 03:18:18 GMT
  2262. Phone: (714) 856-5039
  2263.  
  2264. [NOTE: Most of you have already seen this at one time or another,
  2265. but because the list is distributed to local exploders, I can't be
  2266. sure all readers have seen it.  I'll be posting it once a month or
  2267. so from now on.  Feel free to ignore it if you are already familiar
  2268. with it - Mark]
  2269.  
  2270.         About... The Think C electronic mailing list
  2271.         --------------------------------------------
  2272.  
  2273. This list has been created to discuss topics of interest among users of
  2274. Symantec's Think C compiler for the Macintosh personal computer.  These
  2275. topics include:
  2276.  
  2277.     o programming tips and examples
  2278.  
  2279.     o discussion of compiler bugs and/or misfeatures and workarounds
  2280.  
  2281.     o questions related to programming the Macintosh with Think C and/or
  2282.       object-oriented programming
  2283.  
  2284. One request: if someone submits a question on something that seems simple to
  2285. you, please remember that it will seem simple to many of the other 300+
  2286. subscribers to the list.  Please reply to the sender directly unless you
  2287. feel it is warranted to broadcast the reply.  The person who submitted the
  2288. question is urged to followup at some time in the future with a summary of
  2289. responses, so others who might be interested can see what the solution was.
  2290. This simple rule will prevent much of the chaff that is present on many
  2291. mailing lists and newsgroups.
  2292.  
  2293. Archives of past discussions on the list are stored in the Think C Archive
  2294. (see below for access information) in the directory /mac/think-c/archives.
  2295.  
  2296. Requests for addition/deletion/address/questions changes should be sent to:
  2297.  
  2298.     think-c-request@ics.uci.edu
  2299.  
  2300. Submissions to the list should be sent to:
  2301.  
  2302.     think-c@ics.uci.edu
  2303.  
  2304.             About... The Think C Archive
  2305.             ----------------------------
  2306.  
  2307. An archive of submitted source code and other packages related to Think C is
  2308. available from ics.uci.edu via two transfer methods:
  2309.  
  2310.     o anonymous ftp to ics.uci.edu (128.195.1.1)
  2311.  
  2312.     o automated e-mail archive server on ics.uci.edu
  2313.  
  2314. The archive is stored in /mac/think-c for ftp.  To use the archive server,
  2315. send mail to:
  2316.  
  2317.     archive-server@ics.uci.edu
  2318.  
  2319. Extensive help is available for this server by using a subject consisting of
  2320. the word "help."  For there, you should be able to determine how to navigate
  2321. the archive.
  2322.  
  2323. Submissions to the archive may be accomplished in one of two ways:
  2324.  
  2325.     o use anonymous ftp to drop the submission in /incoming on
  2326.       ics.uci.edu and send a note to think-c-request summarizing the
  2327.       submission.
  2328.  
  2329.     o use electronic mail to send the submission to think-c-request.
  2330.  
  2331. After the submission has been moved to the proper directory in the archive,
  2332. a notice will be sent to the list describing the new addition(s) to the
  2333. archive.  These notices will always have subject headers of the form
  2334. 'ARCHIVE: xxx', where xxx is a brief description of the new addition.
  2335.  
  2336. WARNING: Items stored in the archive is not guaranteed in any way to have
  2337. been tested for functionality or absence of virii.  Retrieve and use at your
  2338. own risk.
  2339.  
  2340. Mark Nagel <nagel@ics.uci.edu>
  2341. Department of Information and Computer Science
  2342. University of California
  2343. Irvine, CA  92717
  2344. 
  2345. 
  2346. Path: ucivax!gateway
  2347. From: kahn@informatics.wustl.edu (Michael Kahn)
  2348. Subject: Deletion and Addition
  2349. Message-ID: <9102211501.AA20411@informatics.WUstl.EDU>
  2350. Newsgroups: fa.think-c
  2351. Lines: 14
  2352. Date: 21 Feb 91 15:04:26 GMT
  2353.  
  2354. Please delete:  kahn@informatics.WUSTL.EDU
  2355.                 kahn@wucs1.WUSTL.EDU
  2356.                 kahn@wubic3.WUSTL.EDU
  2357.                 kahn@sumex-aim.STANFORD.EDU
  2358. (I can't remember which address I used when I signed up)
  2359.  
  2360. Please add:     think-c@informatics.WUSTL.EDU
  2361.  
  2362. This is a mail alias that will redistribute the think-c postings to
  2363. interested parties in our lab.
  2364.  
  2365. THanks,
  2366. Michael Kahn
  2367. (kahn@informatics.wustl.edu)
  2368. 
  2369. 
  2370. Path: ucivax!gateway
  2371. From: minow@bolt.enet.dec.COM ("Martin Minow, ML3-5/U26  21-Feb-1991 1052")
  2372. Subject: re: TCK Dawdle() methods and sleep times
  2373. Message-ID: <9102211656.AA00106@decpa.pa.dec.com>
  2374. Newsgroups: fa.think-c
  2375. Lines: 9
  2376. Date: 21 Feb 91 17:02:04 GMT
  2377.  
  2378. According to rumor (someone told me this last night), set the
  2379. maxSleep to zero and you'll be re-entered.  In my case, Dawdle
  2380. dequeues a "work request" -- if it suceeds, I (plan to) set maxSleep
  2381. to zero so Dawdle is re-entered to dequeue another request.  This
  2382. is a better approach than looping on the dequeue operation as it
  2383. lets the rest of the event loop run each time.
  2384.  
  2385. Martin.
  2386. minow@bolt.enet.dec.com
  2387. 
  2388. 
  2389. Path: ucivax!gateway
  2390. From: nick@lfcs.edinburgh.ac.UK (Nick Rothwell)
  2391. Subject: All you wanted to know about MIDI Manager
  2392. Message-ID: <1653.9102201705@lfcs.ed.ac.uk>
  2393. Newsgroups: fa.think-c
  2394. Lines: 209
  2395. Date: 22 Feb 91 10:56:28 GMT
  2396.  
  2397. >Would someone (Nick...) like to expound upon the benefits of using Apple's
  2398. >MIDI Manager, what it is, what it does, and how one gets it?  I can't seem
  2399. to
  2400. >find mention of it in any of the Apple literature I have, nor is it listed
  2401. on
  2402. >Apple's confidential price list.
  2403.  
  2404. Well, I'll reply to the THINK C list as well as EMUSIC - it might be of
  2405. interest there as well.
  2406.  
  2407. What the hell, I'll fire this off to rec.music.synth and the Mac newsgroups
  2408. as well. That way, NOBODY will EVER have to ask about MIDI Manager again.
  2409. Right? Check...
  2410.  
  2411. Non-Mac people might find this interesting as an overview of how to do MIDI
  2412. cleanly in a hardware independent manner, and how to provide a clean
  2413. abstract interface to the system services required by a MIDI application
  2414. and MIDI working environment.
  2415.  
  2416. Well, how one gets it for a start. Via APDA, I believe. Actually, I managed
  2417. to find MIDI Manager 2.0 on an FTP site somewhere with the Lime notation
  2418. software.
  2419. Apple haven't publicised it because they're still tied up in a lawsuit with
  2420. Apple Corp., the Beatles' record company.
  2421.  
  2422. There are three releases: 1.1, 1.2 and 2.0. 1.1 was the initial release
  2423. (1.0 never made it out the door). 1.2 fixed the odd bug, but rendered MM
  2424. useable only on machines with 256K ROM's, so the Mac Plus was out. 2.0
  2425. presumably has extra features, but I don't have any documentation for it,
  2426. so I don't know about them. All I know is that it seems a lot more
  2427. efficient. MOTU's Performer under MM1.2 was pretty sluggish even on an
  2428. SE/30. Performer under MM2.0 is fine. I don't know if MM2.0 runs on a Plus
  2429. or not.
  2430.  
  2431. What is it? Well, the first MIDI routines for the Mac were the usual
  2432. read-a-byte write-a-byte kind of thing. Various buggy versions of Kirk
  2433. Austin's assembly code were floating around all over the place, and even
  2434. today there are still lots of roll-your-own MIDI driving routines
  2435. (HyperMIDI, MIT toolkit, and so on). These are Bad News. Let me explain
  2436. why.
  2437.  
  2438. [AN ASIDE: Macintoshes have two serial ports, which support RS424 (I think
  2439. - the balanced-pair hardware spec. anyway). These are identical (modulo
  2440. processor interrupt priority) and plenty fast enough to run at MIDI speeds;
  2441. after all, they take AppleTalk in their stride. You need some hardware to
  2442. generate MIDI from RS424; you have to convert voltages, nail one half of
  2443. the RS424 to ground, build the current loop, and opto-isolate the input. In
  2444. addition, the interface provides the 1MHz (usually) signal to clock the
  2445. UART, rather than having the Mac try to invent a suitable baud-rate. So, a
  2446. Mac can support two independent MIDI Ins and Outs for 32 channels each way
  2447. if you use the serial ports; if you want more than that, you can pull
  2448. tricks like using a multiplexing protocol - this is what MOTU do for their
  2449. MIDI Time Piece, using an otherwise undefined MIDI Status Byte to signify
  2450. cable number. So, a MIDI interface is just a box of cheap electronics. I
  2451. built a dual-port MIDI interface with bi-colour activity LED's for about
  2452. $20. If you don't want to do that, feel free to pay Opcode $200 for
  2453. something similar. I don't know of any incompatibilities of the sort you
  2454. can get with weird mutant MP401 clones on the PC.]
  2455.  
  2456. Anyway: why not roll your own MIDI routines?
  2457.  
  2458.         o Hardware dependency. Sure, your routines worked fine on the Mac
  2459. 512K,
  2460.           but for some reason they can't handle the auto sleep routines on
  2461.           the Portable (ain't that right Marc?). 'Nuff said?
  2462.  
  2463.         o Software parsing of MIDI. It's a real hassle, especially if you
  2464.           want to do it right and not fall flat when faced with embedded
  2465.           realtime bytes. And if you want to read and convert MIDI Time
  2466. Code
  2467.           and yes run fast enough to handle full-speed SysEx dumps from
  2468.           samplers, then it gets to be a headache.
  2469.  
  2470.         o Hardware independence. MIDI is not always going to mean the two
  2471.           serial ports on the back of your Mac. There are now expansion
  2472. cards
  2473.           for the Mac that require to get MIDI feeds from Mac sequencers.
  2474.           And I don't see why everybody should extend their applications to
  2475.           handle those, or MOTU's MTP, or any new gizmo which comes along.
  2476.           In fact, a MIDI program shouldn't know or care whether it's
  2477. talking to
  2478.           a serial port, a plug-in card, another MIDI program, or itself;
  2479. the
  2480.           MIDI data transfers and timing functions should work regardless.
  2481.           Abstraction's a wonderful thing.
  2482.  
  2483.         o Asynchronous communication. Your wonderful ReadAByte/WriteAByte
  2484.           echo routine is going to sound rather silly if everything hangs
  2485.           for a few seconds when you change layers under MultiFinder or
  2486. open
  2487.           the Control Panel. MIDI communication should be running all the
  2488. time,
  2489.           in real time, and not be tied to the event loop. (I know. I've
  2490. done
  2491.           that. It's not pleasant.)
  2492.  
  2493.         o Software cooperation. I don't want my MIDI program to reprogram
  2494. the
  2495.           serial ports and shoot AppleTalk through the head. Nor should it
  2496.           interfere with other programs I'm running. In this age of
  2497. MultiFinder
  2498.           and true multitasking (shut up) a number of MIDI programs should,
  2499. if
  2500.           not actually communicate, then at least stay out of each others'
  2501. way.
  2502.           Of course, it would be ideal if programs could communicate with
  2503. each
  2504.           other. That way you can build MIDI systems out of smaller
  2505. components.
  2506.  
  2507.         o Timing functions. ReadAByte/WriteAByte MIDI routines are rather
  2508.           hopeless for tying a sequencer to MIDI Time Code coming in off
  2509.           a SMPTE-striped tape. Try it if you don't believe me.
  2510.  
  2511. So, MIDI Manager solves all these problems. It's an Apple product, which
  2512. means that (in theory) everyone has it and so every piece of software
  2513. should be using it. Just like the rest of the Toolbox. Why doesn't everyone
  2514. have it? Why haven't you even heard of it? Beats me. Ask the lawyers.
  2515.  
  2516. What do you get? There's a MIDI Manager INIT - this provides the traps for
  2517. the MIDI Manager, and a Sound Manager trap to say that MM is installed and
  2518. running. There's the Apple MIDI Driver - this is the link between the MIDI
  2519. Manager and the serial ports. The AMD will drive either or both ports at
  2520. one of three clock speeds (depending on your interface), and provides some
  2521. timecode services. Other vendors will provide alternative drivers for their
  2522. hardware (I'm eagerly awaiting MOTU's 8 x 8 MTP driver). And there's the
  2523. PatchBay, which lets users graphically connect applications to each other
  2524. and the ports. In fact, the PatchBay can be written using the MIDI Manager
  2525. traps - there's nothing magical about it. (Well, almost nothing.)
  2526.  
  2527. Suppose you want to write a MIDI Manager application. Well, when it starts
  2528. up,
  2529. it has to sign into the MIDI Manager (having verified that MM is
  2530. installed), and it has to sign out when it's finished. MIDI Manager loads
  2531. the port drivers when the first application signs in, and drops them when
  2532. the last application signs out.
  2533.  
  2534. When your application signs in it provides a name and an icon. This is what
  2535. PatchBay uses to display your application to the user.
  2536.  
  2537. To do anything useful, you have to create some communication ports and tell
  2538. MIDI Manager about them. There are three kinds:
  2539.  
  2540.         Input ports: these are created with hook routines which are called
  2541.         when MIDI data arrives for your application.
  2542.  
  2543.         Output ports: you use these to output MIDI data.
  2544.  
  2545.         Timing ports: these are tied to timebases (either internally
  2546. generated
  2547.         or externally linked) and provide timestamps for MIDI data.
  2548.  
  2549. You can have as many ports of whichever kind as you want. These are
  2550. presented in PatchBay; the user can then connect them together so that your
  2551. application ends up talking to serial ports, other applications, whatever.
  2552. Or, you can attach yourself to specific ports (which may still be awaiting
  2553. creation). There are interface guidelines for this.
  2554.  
  2555. The user can attach input and output ports in pairs using PatchBay; data
  2556. flows from output to input. In addition, data can be sent from one output
  2557. to several inputs, or from several outputs to one input (MIDI Manager does
  2558. the merging). The time ports allow applications to synchronise, so that a
  2559. master application (say, a timecode generator) can lock a slave application
  2560. (say, a sequencer). The Apple MIDI Driver provides time ports which read
  2561. real timecode from the outside world.
  2562.  
  2563. I won't go into the timing functions since they're rather complex. Input
  2564. and output is easier. Output is simple - to output a message, put it into a
  2565. buffer and send it. Long messages (SysEx's) are flagged with continuation
  2566. bits. Messages can be queued for future transmission using the time port
  2567. features; this is dead handy, since it means you can avoid SCC overruns by
  2568. staggering transmission timestamps. By being a little more clever, you can
  2569. do your own output buffering and have asynchronous service routines send
  2570. stuff out when required - see my example code for details. It's great to be
  2571. able to queue an entire SysEx bank dump for transmission over the next 30
  2572. seconds and then forget about it - the application happily keeps going,
  2573. responding to the user, regardless, as the data goes out under remote
  2574. control.
  2575.  
  2576. Input is asynchronous. You don't ask for the next message (well, you can,
  2577. but it's not cool). Instead, your read hook is called at interrupt time
  2578. when something arrives. You then get to deal with it then and there
  2579. regardless of what your application is doing otherwise, even if some other
  2580. application is frontmost under MultiFinder. Or, you can reject a message
  2581. and ask to see it again later when you're not busy. MIDI Echo is easy (the
  2582. readhook just sends the message out immediately); more complicated things
  2583. require work since the read hook isn't running in a first-class environment
  2584. - you don't have the usual access to globals, the ToolBox, and so on. But,
  2585. with a little thought, and a few semaphores, it's not too difficult. If you
  2586. have time ports, you can set up timer routines which you interface to much
  2587. like read hooks.
  2588.  
  2589. I don't think there's much more to say. I love MIDI Manager. It's nice to
  2590. see Performer and Anodyne (my MIDI generic editor/librarian) pass data to
  2591. each other and update their progress bargraphs in parallel. There are some
  2592. subtleties to do with giving each application access to its event loop
  2593. every now and then, but nothing difficult for your average Mac power
  2594. programmer. MIDI Manager tends to choke on extremely dense SysEx messages.
  2595. For example, I can capture a D-50 bank dump easily (it's a set of 200-odd
  2596. byte SysEx messages with timing gaps) but the VFX sends a single 65K
  2597. message which is a hassle. The problem is probably that my read hook is a
  2598. fairly ordinary C procedure. If I wanted top-notch performance I'd have to
  2599. assembly-code the thing.
  2600.  
  2601. Can't think of much more to say, really, apart from: APPLE: publicise and
  2602. distribute the damn thing, and everybody else: use it, dammit.
  2603.  
  2604. Nick.
  2605.  
  2606. 
  2607. 
  2608. Path: ucivax!gateway
  2609. From: jim@fpr.COM ("James E. O'Dell")
  2610. Subject: Floating Point constants.
  2611. Message-ID: <9102231410.AA02061@uu.psi.com>
  2612. Newsgroups: fa.think-c
  2613. Reply-To: "James E. O'Dell" <jim@fpr.COM>
  2614. Organization: Fort Pond Research
  2615. Lines: 17
  2616. Date: 23 Feb 91 14:15:33 GMT
  2617.  
  2618. I need to know the actual sizes of the various floating point
  2619. numbers in THINK C. Unfortunately I don't have a SANE book
  2620. nearby.
  2621.  
  2622. When I look in the float.h documentation on page 7 of the THINK C
  2623. manual I notice that DBL_MANT_DIG and LDBL_MANT_DIG are the same.
  2624. Is this really true? Are DBL_DIG and LDBL_DIG also the same? I guess I would have assumed that long doubles would have more mantissa digits.
  2625.  
  2626. Also, I need to know the values of these constants
  2627. for short doubles.
  2628.  
  2629. Thanks for the help!
  2630. Jim O'Dell
  2631. Fort Pond Research
  2632. jim@fpr.com
  2633.  
  2634.  
  2635. 
  2636. 
  2637. Path: ucivax!gateway
  2638. From: jp48+@andrew.cmu.edu (Jonathan Pace)
  2639. Subject: Simple Think C question
  2640. Message-ID: <0blpRGq00WB34DLlpM@andrew.cmu.edu>
  2641. Newsgroups: fa.think-c
  2642. Lines: 9
  2643. Date: 24 Feb 91 06:07:25 GMT
  2644.  
  2645.    I'm working my way through the "Macintosh C Programming Primer" and I've
  2646. bombed on the Hello, World #2 program.  I get the error "invalid declaration"
  2647. when I precompile.  The offending line seems to be:
  2648.  
  2649.    WindowPtr   gHelloWindow;
  2650.  
  2651. I'm clueless.  Help, please.
  2652.  
  2653. Jon Pace
  2654. 
  2655. 
  2656. Path: ucivax!gateway
  2657. From: ephraim@think.COM
  2658. Subject: Think C port of Disinfectant Sample code available
  2659. Message-ID: <9102261456.AA01790@leander.think.com>
  2660. Newsgroups: fa.think-c
  2661. Lines: 13
  2662. Date: 26 Feb 91 14:59:02 GMT
  2663.  
  2664.  
  2665. Each release of John Norstad's Disinfectant program is accompanied by
  2666. a release of Disinfectant's user interface code.  I've ported this
  2667. code to Think C 4.0.2 from MPW C.  The complete package is available
  2668. by anonymous ftp from think.com, in directory /public/disinfectant.
  2669.  
  2670. -r--r--r--  1 ephraim    989967 Feb 26 09:46 sample-2.4.sit.hqx
  2671.  
  2672. Please send bug reports to me, not John Norstad, as they're more
  2673. likely to be conversion problems than bugs in John's original code.
  2674.  
  2675. For MPW users, John's version of the package is available by anonymous
  2676. ftp from acns.nwu.edu, in directory /pub/disinfectant.
  2677. 
  2678. 
  2679. Path: ucivax!gateway
  2680. From: nagel@ICS.UCI.EDU (Mark Nagel)
  2681. Subject: ARCHIVE: Disinfectant interface code
  2682. Message-ID: <5393.667683153@ics.uci.edu>
  2683. Newsgroups: fa.think-c
  2684. Reply-To: nagel@ICS.UCI.EDU
  2685. Organization: University of California, Irvine - Dept of ICS
  2686. Lines: 29
  2687. Date: 27 Feb 91 19:35:52 GMT
  2688. Phone: (714) 856-5039
  2689.  
  2690. By request, I've added the THINK C port of the Disinfectant
  2691. interface source code to the archives.
  2692.  
  2693. Below is the original announcement for those of you who missed it.
  2694.  
  2695. Mark
  2696.  
  2697. /*****************************************************************************/
  2698.  
  2699. From: ephraim@think.COM
  2700. Subject: Think C port of Disinfectant Sample code available
  2701. Date: 26 Feb 91 14:59:02 GMT
  2702.  
  2703. Each release of John Norstad's Disinfectant program is accompanied by
  2704. a release of Disinfectant's user interface code.  I've ported this
  2705. code to Think C 4.0.2 from MPW C.  The complete package is available
  2706. by anonymous ftp from think.com, in directory /public/disinfectant.
  2707.  
  2708. -r--r--r--  1 ephraim    989967 Feb 26 09:46 sample-2.4.sit.hqx
  2709.  
  2710. Please send bug reports to me, not John Norstad, as they're more
  2711. likely to be conversion problems than bugs in John's original code.
  2712.  
  2713. For MPW users, John's version of the package is available by anonymous
  2714. ftp from acns.nwu.edu, in directory /pub/disinfectant.
  2715.  
  2716. /*****************************************************************************/
  2717.  
  2718. [saved as: /mac/think-c/code/disinfectant-24.hqx; 976K]
  2719. 
  2720. 
  2721. Path: ucivax!gateway
  2722. From: dickie@math.wisc.edu (Garth Dickie)
  2723. Subject: class declarations
  2724. Message-ID: <9102272107.AA01278@macduffe>
  2725. Newsgroups: fa.think-c
  2726. Lines: 61
  2727. Date: 27 Feb 91 21:26:10 GMT
  2728.  
  2729. I am writing a class library for TC4; I want to experiment with some stuff
  2730. which doesn't fit into the TCL.  This question has to do with the way I create
  2731. objects from resource templates.
  2732.  
  2733. The idea is to correlate an integer with every class which may be instantiated
  2734. from a template.  Then that integer is translated at runtime into a void*,
  2735. which can be passed to new to get an object of the appropriate type.  What I
  2736. *don't* want to do is a switch with one line per class, or similar kludery.
  2737.  
  2738. Idealy, the template reader is a library routine which does not depend on the
  2739. actual classes being instantiated.  The current implementation is that the
  2740. integers are indexes into a table of void*, which is static, initialized
  2741. with the class names.  The source looks like:
  2742.  
  2743. -- for the table:
  2744.  
  2745. static void *classes[] = {
  2746. #include "classes.n"
  2747. }
  2748.  
  2749. -- for SARez, in the middle of a type definition,
  2750.  
  2751. decimal integer
  2752. #include "classes.n"
  2753. ;
  2754.  
  2755. where "classes.n" is a comma-separated list of the class names.  The effect for
  2756. the table is to create an array of exactly the correct size, initialized with
  2757. void* values which may be passed to new in order to create an object.  The
  2758. effect for the Rez source is to create an enumerated integer field:  If in the
  2759. correct place it encounters the name of a class, it will output the index of
  2760. the class name in the classes.n file.  This is fine.
  2761.  
  2762. The trouble is, there must be a class declaration for *every class used* before
  2763. the table can be declared.  In practice, what this means is another file,
  2764. classes.h, which has a line '#include "class_name.h"' for each class.  Then
  2765. this file must be included before the table can be declared.
  2766.  
  2767. There are two big problems here:
  2768.  -- whenever a class header file is touched, the table is recompiled, which
  2769.     means reading every other header file, etc.
  2770.  
  2771.  -- I'm back to having two sets of values, classes.n and classes.h, which must
  2772.     be kept in sync.
  2773.  
  2774. Both of these situations ideally would be resolved by the linker.  That is, in
  2775. some contexts, class names are like function names.  If you pass one to new,
  2776. it is converted into a void*, and treated like a global extern, with the linker
  2777. resolving just what value to pass.  In effect, the declaration
  2778.  
  2779. struct base_class : indirect { a_method( void ); };
  2780.  
  2781. does two things:  It makes some kind of global entry that the linker resolves
  2782. which says 'base_class should resolve to a void*', and it makes an extern
  2783. declaration so that everything after that point knows about it.  What I would
  2784. like is a way to make this extern declaration without defining the value.  It
  2785. seems that there is some way for the linker to resolve this already -- there
  2786. is just no way to declare it.
  2787.  
  2788. Any ideas or help on this?
  2789.  -- garth
  2790. 
  2791. 
  2792. Path: ucivax!gateway
  2793. From: PET101@ukcc.uky.edu (Jamer)
  2794. Subject: subscription
  2795. Message-ID: <9102281112.aa18656@ICS.UCI.EDU>
  2796. Newsgroups: fa.think-c
  2797. Lines: 7
  2798. Date: 28 Feb 91 19:18:03 GMT
  2799.  
  2800. Please subscribe me to this list.  I sent a request to listserv, but
  2801. apparently there isn't one.
  2802.  
  2803. Thanks.
  2804.  
  2805. Jamer Tittle
  2806. <PET101@ukcc.uky.edu>
  2807. 
  2808.